-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
45 lines (43 loc) · 1.45 KB
/
webpack.prod.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
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
// TODO: npm install was not downloading this plugin, causing module not found errors
// const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = merge(common, {
mode: 'production',
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: false,
uglifyOptions: {
toplevel: true,
minimize: true,
output: {
beautify: false,
indent_level: 1,
comments: false
},
unused: true,
dead_code: true,
mangle: true,
compress: {
conditionals: true,
drop_debugger: true,
dead_code: true,
evaluate: true,
sequences: true,
booleans: true,
warnings: false
}
}
}),
// new OptimizeCSSAssetsPlugin({})
]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
});