diff --git a/.babelrc b/.babelrc index d84ff631..24de2d7d 100644 --- a/.babelrc +++ b/.babelrc @@ -8,9 +8,6 @@ "env": { "test": { "plugins": ["istanbul"] - }, - "production": { - "plugins": ["transform-react-constant-elements"] } } } diff --git a/package.json b/package.json index 6554af3b..fde3ef30 100644 --- a/package.json +++ b/package.json @@ -152,6 +152,7 @@ "stylelint-config-standard": "^18.0.0", "stylelint-order": "^0.7.0", "stylelint-webpack-plugin": "^0.9.0", + "uglifyjs-webpack-plugin": "^1.1.2", "url-loader": "^0.6.2", "webpack": "^3.8.1", "webpack-dev-server": "^2.9.5" diff --git a/webpack/base.config.js b/webpack/base.config.js index 03b8716c..08b7ce00 100644 --- a/webpack/base.config.js +++ b/webpack/base.config.js @@ -1,5 +1,7 @@ +/* eslint-disable */ const path = require('path'); const webpack = require('webpack'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const StyleLintPlugin = require('stylelint-webpack-plugin'); const pkg = require('../package.json'); @@ -24,9 +26,14 @@ if (env === 'production') { NODE_ENV: JSON.stringify('production') } })); - plugins.push(new webpack.optimize.UglifyJsPlugin({ - compress: { warnings: false }, - output: { inline_script: true } + plugins.push(new UglifyJsPlugin({ + uglifyOptions: { + compress: { warnings: false }, + output: { + comments: /^! mochawesome/, + inline_script: true + }, + } })); }