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"