-
Notifications
You must be signed in to change notification settings - Fork 65
/
webpack.config.js
52 lines (49 loc) · 1.28 KB
/
webpack.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// webpack v4
const path = require('path');
const CompressionPlugin = require('compression-webpack-plugin');
const shouldCompress = /\.(js|css|html|svg)(\.map)?$/
module.exports = {
mode: 'production',
entry: './dist/browser/src',
output: {
path: path.join(path.resolve(__dirname), 'dist', 'browser', 'static'),
filename: 'browser.js',
library: 'irc-framework',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [ ]
},
resolve: {
fallback: {
// Fallback modules for node internals when building with webpack5
'stream': require.resolve('stream-browserify'),
'buffer': require.resolve('buffer/'),
'util': require.resolve('util/'),
},
},
plugins: [
new CompressionPlugin({
filename: "[path][base].gz",
algorithm: "gzip",
test: shouldCompress,
}),
new CompressionPlugin({
filename: "[path][base].br",
algorithm: 'brotliCompress',
test: shouldCompress,
}),
],
optimization: {
minimize: true
},
devtool: 'source-map',
performance: {
assetFilter: assetFilename =>
!assetFilename.match(/\.map(\.(gz|br))?$/),
// Prevent warnings about entrypoint and asset size
maxEntrypointSize: 343040, // 335KiB
maxAssetSize: 343040, // 335KiB
},
};