2022-03-12 23:58:44 +01:00
|
|
|
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/,
|
|
|
|
},
|
2022-03-23 19:08:52 +01:00
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
|
|
|
use: ["style-loader", "css-loader"],
|
|
|
|
},
|
2022-03-12 23:58:44 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|