diff --git a/webpack.prod.js b/webpack.prod.js index 4990abcea..c9af8304c 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -3,36 +3,30 @@ const common = require('./webpack.common.js'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); const TerserPlugin = require('terser-webpack-plugin'); +const terserPlugin = new TerserPlugin({ + parallel: true, + sourceMap: false, + cache: true, + extractComments: false, + terserOptions: { + output: { + comments: /translators:/i, + }, + mangle: { + reserved: ["__"], + } + }, +}); + module.exports = merge(common, { mode: 'production', devtool: undefined, plugins: [ - // new webpack.LoaderOptionsPlugin({ - // minimize: true - // }), new VueLoaderPlugin(), ], optimization: { - minimizer: [ - new TerserPlugin({ - parallel: true, - sourceMap: false, - cache: true, - terserOptions: { - // We preserve function names that start with capital letters as - // they're _likely_ component names, and these are useful to have - // in tracebacks and error messages. - keep_fnames: /__|_x|_n|_nx/, - mangle: { - keep_fnames: /__|_x|_n|_nx/, - }, - output: { - comments: /translators:/i, - }, - }, - extractComments: false, - }), - ] + minimize: true, + minimizer: [terserPlugin] }, resolve: { alias: {