From c12463b283d4cb2264fd827e78f8e2f362fdc22a Mon Sep 17 00:00:00 2001 From: smallwei <1634566606@qq.com> Date: Sun, 18 Feb 2018 20:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=8E=8B=E7=BC=A9=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.prod.conf.js | 15 +++++++++------ package.json | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 572ed36d..8def6e0e 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -8,11 +8,11 @@ var CopyWebpackPlugin = require('copy-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin') var ExtractTextPlugin = require('extract-text-webpack-plugin') var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') - +var UglifyJsPlugin = require('uglifyjs-webpack-plugin') var env = config.build.env function resolveApp(relativePath) { - return path.resolve(relativePath); + return path.resolve(relativePath); } var webpackConfig = merge(baseWebpackConfig, { @@ -33,11 +33,14 @@ var webpackConfig = merge(baseWebpackConfig, { new webpack.DefinePlugin({ 'process.env': env }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } }, - sourceMap: true + sourceMap: config.build.productionSourceMap, + parallel: true }), // extract css into its own file new ExtractTextPlugin({ diff --git a/package.json b/package.json index 5e03584e..f19ad3f6 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "semver": "5.4.1", "shelljs": "0.7.8", "svg-sprite-loader": "3.4.1", + "uglifyjs-webpack-plugin": "^1.2.0", "url-loader": "0.6.1", "vue-loader": "13.5.0", "vue-style-loader": "3.0.3",