You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
803 B
43 lines
803 B
3 years ago
|
const path = require('path');
|
||
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||
|
|
||
|
module.exports = {
|
||
|
entry: './src/app.ts',
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.tsx?$/,
|
||
|
use: 'ts-loader',
|
||
|
exclude: /node_modules/,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
resolve: {
|
||
|
extensions: ['.tsx', '.ts', '.js'],
|
||
|
},
|
||
|
output: {
|
||
|
filename: '[name].js',
|
||
|
path: path.resolve(__dirname, './www/'),
|
||
|
clean: true,
|
||
|
},
|
||
|
plugins: [
|
||
|
new HtmlWebpackPlugin({
|
||
|
template: './src/index.html',
|
||
|
hash: true
|
||
|
})
|
||
|
],
|
||
|
optimization: {
|
||
|
moduleIds: 'deterministic',
|
||
|
runtimeChunk: 'single',
|
||
|
splitChunks: {
|
||
|
cacheGroups: {
|
||
|
vendor: {
|
||
|
test: /[\\/]node_modules[\\/]/,
|
||
|
name: 'vendors',
|
||
|
chunks: 'all',
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
};
|