From 0935f20c111de7ee59058d64487787f86a804590 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Feb 2018 18:35:27 -0800 Subject: [PATCH] update webpack config --- package.json | 1 + support/webpack/config.js | 2 ++ yarn.lock | 6 ------ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index acb39a2d3..7ffd49783 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "style-loader": "^0.20.2", "to-camel-case": "^1.0.0", "to-title-case": "^1.0.0", + "uglifyjs-webpack-plugin": "^1.1.8", "webpack": "^3.11.0", "webpack-dev-server": "^2.11.1", "yaml-js": "^0.2.0" diff --git a/support/webpack/config.js b/support/webpack/config.js index e3932e434..92bff167e 100644 --- a/support/webpack/config.js +++ b/support/webpack/config.js @@ -4,6 +4,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackTemplate = require('html-webpack-template') const ExtractTextPlugin = require('extract-text-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin') +const UglifyJSPlugin = require('uglifyjs-webpack-plugin') const NamedModulesPlugin = webpack.NamedModulesPlugin const HotModuleReplacementPlugin = webpack.HotModuleReplacementPlugin @@ -62,6 +63,7 @@ const config = { ], }), IS_PROD && new CopyWebpackPlugin(['examples/CNAME']), + IS_PROD && new UglifyJSPlugin({ sourceMap: true }), IS_DEV && new NamedModulesPlugin(), IS_DEV && new HotModuleReplacementPlugin(), ].filter(Boolean), diff --git a/yarn.lock b/yarn.lock index 56a19829a..2932b48f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1687,12 +1687,6 @@ clean-css@4.1.x: dependencies: source-map "0.5.x" -clean-webpack-plugin@^0.1.18: - version "0.1.18" - resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.18.tgz#2e2173897c76646031bff047c14b9c22c80d8c4a" - dependencies: - rimraf "^2.6.1" - cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"