diff --git a/build/webpack.config.prod.js b/build/webpack.config.prod.js index 1b091d8..1332bda 100644 --- a/build/webpack.config.prod.js +++ b/build/webpack.config.prod.js @@ -4,7 +4,7 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin') const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') -const UglifyJsPlugin = require('uglifyjs-webpack-plugin') +const TerserPlugin = require('terser-webpack-plugin'); const path = require('path'); @@ -38,6 +38,11 @@ module.exports = { poll: true } }, + optimization: { + minimizer: [new TerserPlugin({ + sourceMap: true, + })], + }, module: { rules: [ { @@ -109,15 +114,6 @@ module.exports = { new webpack.DefinePlugin({ 'process.env': JSON.stringify('production'), }), - new UglifyJsPlugin({ - uglifyOptions: { - compress: { - warnings: false - } - }, - sourceMap: true, - parallel: true - }), new OptimizeCSSPlugin({ cssProcessorOptions: { safe: true, @@ -147,4 +143,4 @@ module.exports = { to: resolvePath('www/static'), }]), ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index bc16bd2..3826fa7 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "ora": "^3.0.0", "stylus": "^0.54.5", "stylus-loader": "^3.0.2", - "uglifyjs-webpack-plugin": "^2.1.1", + "terser-webpack-plugin": "^2.1.2", "url-loader": "^1.1.2", "vue-loader": "^15.6.2", "vue-style-loader": "^4.1.2",