-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
40 lines (36 loc) · 1 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
// const webpack = require('webpack')
const {merge} = require('webpack-merge')
// uglifyjs-webpack-plugin does not work now:
// see: https://stackoverflow.com/questions/47439067
// we could use "uglifyjs-webpack-plugin": "1.0.0" force
// however, an alternative solution is to use terser-webpack-plugin instead
// see: https://git.io/fhSjx
//
// For this discussion, see also: https://git.io/fhSjA
// const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
// plugins: [
// new UglifyJSPlugin({
// sourceMap: true,
// parallel: true,
// // exclude: /query-string/,
// }),
// ],
optimization: {
minimizer: [
new TerserPlugin({
// cache: true,
parallel: true,
terserOptions: {
output: {
comments: false,
},
},
}),
],
},
})