From 6d20bfa4931347fc9593280d84d0979e201f2cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Wed, 28 Aug 2019 20:32:45 +0200 Subject: [PATCH] Remove comments from javascript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- package.json | 1 + webpack.prod.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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, + })], + } });