fix: webpack production

This commit is contained in:
vnmedeiros 2020-11-19 17:37:45 -03:00
parent 8df8f2fe59
commit fc490466c4
1 changed files with 17 additions and 23 deletions

View File

@ -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: {