-
Notifications
You must be signed in to change notification settings - Fork 18
/
production.client.babel.js
45 lines (44 loc) · 1.05 KB
/
production.client.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
40
41
42
43
44
45
import webpack from 'webpack';
import baseConfig from './base';
import CompressionPlugin from 'compression-webpack-plugin';
import UglifyJSPlugin from 'uglifyjs-webpack-plugin';
import merge from 'webpack-merge';
import config from '../config';
export default merge(baseConfig, {
output: {
filename: '[name].[hash].js',
chunkFilename: config.enableDynamicImports ? '[name].[hash].js' : undefined
},
optimization: {
splitChunks: {
chunks: 'all',
name: true
}
},
plugins: [
new webpack.BannerPlugin({
banner:
'hash:[hash], chunkhash:[chunkhash], name:[name], ' +
'filebase:[filebase], query:[query], file:[file]'
}),
new UglifyJSPlugin({
uglifyOptions: {
parallel: 4,
compress: {
warnings: false
},
mangle: true,
output: {
comments: false
}
}
}),
new CompressionPlugin({
asset: '[file].gz',
algorithm: 'gzip',
test: /\.css$|\.js$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
]
});