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 VueLoaderPlugin = require('vue-loader/lib/plugin');
const TerserPlugin = require('terser-webpack-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, { module.exports = merge(common, {
mode: 'production', mode: 'production',
devtool: undefined, devtool: undefined,
plugins: [ plugins: [
// new webpack.LoaderOptionsPlugin({
// minimize: true
// }),
new VueLoaderPlugin(), new VueLoaderPlugin(),
], ],
optimization: { optimization: {
minimizer: [ minimize: true,
new TerserPlugin({ minimizer: [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,
}),
]
}, },
resolve: { resolve: {
alias: { alias: {