Don't run UglifyJS unless it's a production build

This commit is contained in:
Andrew Sun͈̮ 2017-11-27 15:11:56 -05:00 committed by Andrew Sun
parent 8f4bc64154
commit f392678174

View file

@ -141,9 +141,6 @@ module.exports = {
{from: 'static'},
{from: 'intl', to: 'js'}
]),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"' + (process.env.NODE_ENV || 'development') + '"',
'process.env.SENTRY_DSN': '"' + (process.env.SENTRY_DSN || '') + '"',
@ -154,5 +151,11 @@ module.exports = {
name: 'common',
filename: 'js/common.bundle.js'
})
])
]).concat(process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
] : [])
};