mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-21 11:24:20 +01:00
html: migrate to typescript
This commit is contained in:
@@ -3,7 +3,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const devMode = process.env.NODE_ENV !== 'production';
|
||||
|
||||
module.exports = {
|
||||
entry: './js/app.js',
|
||||
entry: './js/app.ts',
|
||||
output: {
|
||||
path: __dirname + '/dist',
|
||||
filename: devMode ? '[name].js' : '[name].[hash].js',
|
||||
@@ -12,7 +12,7 @@ module.exports = {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules\/(?!zmodem.js\/)/,
|
||||
include: __dirname + '/node_modules/zmodem.js',
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
@@ -20,6 +20,11 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.s?[ac]ss$/,
|
||||
use: [
|
||||
@@ -30,6 +35,9 @@ module.exports = {
|
||||
},
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: [ '.tsx', '.ts', '.js' ]
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin([
|
||||
{ from: 'favicon.png', to: '.' }
|
||||
@@ -42,5 +50,5 @@ module.exports = {
|
||||
performance : {
|
||||
hints : false
|
||||
},
|
||||
devtool: devMode ? 'cheap-module-eval-source-map' : 'source-map',
|
||||
}
|
||||
devtool: 'inline-source-map',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user