From 9765122df435c08c51122d20318ef4b923c61a7e Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 4 Aug 2018 09:12:04 +0800 Subject: [PATCH] Extract license comments --- webpack.config.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index ba142e59..e1f0cbf3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const UglifyJsWebpackPlugin = require('uglifyjs-webpack-plugin'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const WebpackBar = require('webpackbar'); @@ -104,10 +104,18 @@ module.exports = [{ ], optimization: { minimizer: [ - new UglifyJsPlugin({ + new UglifyJsWebpackPlugin({ + parallel: true, cache: true, - parallel: 4, - extractComments: 'lib-license.txt' + sourceMap: false, + extractComments: { + filename: 'LICENSES' + }, + uglifyOptions: { + output: { + comments: /^\**!|@preserve|@license|@cc_on/ + } + } }) ] },