From fc490466c43a87d414f4bbea439182d1d26995ba Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Thu, 19 Nov 2020 17:37:45 -0300 Subject: [PATCH] fix: webpack production --- webpack.prod.js | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) 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: {