Adding missing dependency and linting webpack.js (#3008)

This commit is contained in:
Maxime Beauchemin 2017-06-20 14:04:36 -07:00 committed by GitHub
parent 06fcaa3095
commit 4d72afb54b
2 changed files with 12 additions and 12 deletions

View File

@ -125,6 +125,7 @@
"sinon": "^2.1.0",
"style-loader": "^0.18.2",
"transform-loader": "^0.2.3",
"uglifyjs-webpack-plugin": "^0.4.6",
"url-loader": "^0.5.7",
"webpack": "^2.3.3",
"webpack-manifest-plugin": "1.1.0",

View File

@ -125,17 +125,16 @@ const config = {
],
};
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
// Using settings suggested in https://github.com/webpack/webpack/issues/537
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
minimize: true,
compress: {
drop_debugger: true,
warnings: false,
drop_console: true,
},
}),
);
// Using settings suggested in https://github.com/webpack/webpack/issues/537
const UJSplugin = new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
minimize: true,
compress: {
drop_debugger: true,
warnings: false,
drop_console: true,
},
});
config.plugins.push(UJSplugin);
}
module.exports = config;