2020-11-19 19:22:43 +00:00
|
|
|
const { merge } = require('webpack-merge');
|
|
|
|
const common = require('./webpack.common.js');
|
|
|
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
|
2020-11-19 20:37:45 +00:00
|
|
|
const terserPlugin = new TerserPlugin({
|
|
|
|
parallel: true,
|
|
|
|
sourceMap: false,
|
|
|
|
cache: true,
|
|
|
|
extractComments: false,
|
|
|
|
terserOptions: {
|
|
|
|
output: {
|
|
|
|
comments: /translators:/i,
|
|
|
|
},
|
|
|
|
mangle: {
|
|
|
|
reserved: ["__"],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-11-19 19:22:43 +00:00
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: 'production',
|
|
|
|
devtool: undefined,
|
|
|
|
plugins: [
|
|
|
|
new VueLoaderPlugin(),
|
|
|
|
],
|
|
|
|
optimization: {
|
2020-11-19 20:37:45 +00:00
|
|
|
minimize: true,
|
|
|
|
minimizer: [terserPlugin]
|
2020-11-19 19:22:43 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'vue$': 'vue/dist/vue.min',
|
|
|
|
'Swiper$': 'swiper/js/swiper.min.js'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|