-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dist.config.js
37 lines (32 loc) · 1.01 KB
/
webpack.dist.config.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
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const merge = require('webpack-merge');
// Define maximum asset size before gzipping
const MAX_ASSET_SIZE_KB = 23;
const MAX_ASSET_SIZE_BYTES = MAX_ASSET_SIZE_KB * 1024;
module.exports = merge.smart(require('./webpack.config'), {
mode: 'production',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'kvs-webrtc.min.js',
},
// Make sure the asset is not accidentally growing in size
// Make sure that size impact of adding new code is known
performance: {
hints: 'error',
maxAssetSize: MAX_ASSET_SIZE_BYTES,
maxEntrypointSize: MAX_ASSET_SIZE_BYTES,
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: /kvs-webrtc\.LICENSE/i,
},
},
extractComments: false,
}),
],
},
});