replaced UglifyJsPlugin with TerserPlugin

This commit is contained in:
or-else
2020-03-14 09:39:52 +03:00
parent 475e5eb3e7
commit dbcac419de
10 changed files with 6775 additions and 8624 deletions
+17 -9
View File
@@ -1,4 +1,4 @@
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
@@ -27,15 +27,23 @@ module.exports = (env, argv) => {
},
optimization: {
minimizer: [
// we specify a custom UglifyJsPlugin here to get source maps in production.
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: true,
mangle: true
new TerserPlugin({
sourceMap: true,
terserOptions: {
ecma: undefined,
warnings: false,
parse: {},
compress: {},
mangle: true, // Note `mangle.properties` is `false` by default.
module: false,
output: null,
toplevel: false,
nameCache: null,
ie8: false,
keep_classnames: undefined,
keep_fnames: false,
safari10: false,
},
sourceMap: true
})
]
},