-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.babel.js
39 lines (38 loc) · 1.03 KB
/
webpack.config.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import path from 'path'
module.exports = {
mode: 'production',
entry: {
main: './src/main.ts',
noise_channel_worker: './src/noise_channel_worker.ts',
dmc_channel_worker: './src/dmc_channel_worker.ts',
dc_remove_worker: './src/dc_remove_worker.ts',
},
output: {
path: path.resolve(__dirname, 'public/assets'),
filename: '[name].js',
sourceMapFilename: '[name].map',
},
resolve: {
extensions: ['.ts', '.js', '.html'],
},
module: {
rules: [
{test: /\.ts$/, include: /src/, exclude: /node_modules/, use: {loader: 'ts-loader'}},
{test: /\.html$/, include: /src/, exclude: /node_modules/, use: {loader: 'html-loader', options: {minimize: true}}},
{test: /\.(png|svg)$/, include: /src/, exclude: /node_modules/, type: 'asset/inline'},
],
},
optimization: {
splitChunks: {
cacheGroups: {
lib: {
test: /[\\/]node_modules[\\/]/,
name: 'lib',
enforce: true,
chunks: 'all',
},
},
},
usedExports: true,
},
}