diff --git a/package.json b/package.json index 7ae3d02a..86d4a24a 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "stylelint-scss": "^3.10.0", "stylelint-webpack-plugin": "^0.10.5", "svg-sprite": "^1.5.0", + "terser-webpack-plugin": "^1.4.1", "vue-click-outside": "^1.0.7", "vue-jest": "^3.0.4", "vue-loader": "^15.7.1", diff --git a/webpack.prod.js b/webpack.prod.js index cdb93905..a66a8f22 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,7 +1,18 @@ const merge = require('webpack-merge') const common = require('./webpack.common.js') +const TerserPlugin = require('terser-webpack-plugin') module.exports = merge(common, { mode: 'production', - devtool: '#source-map' + devtool: '#source-map', + optimization: { + minimizer: [new TerserPlugin({ + terserOptions: { + output: { + comments: false, + } + }, + sourceMap: true, + })], + } });