Build the minified version in production mode

This is probably not the way to do this, I may want to just have
multiple versions, dev+production * full+min
main
Aaron Jensen 2015-08-09 22:40:23 -07:00
parent 32f69339a5
commit b1701b09bd
2 changed files with 19 additions and 5 deletions

View File

@ -29,11 +29,24 @@ module.exports = function createWebpackConfig(_options) {
config.output.filename = options.filename;
if (options.minify) {
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
},
}));
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
warnings: false,
},
})
);
}
if (options.env) {
config.plugins.push(
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(options.env),
},
})
);
}
return config;

View File

@ -76,6 +76,7 @@ gulp.task('webpack:standalone:min', function() {
var config = createWebpackConfig({
filename: 'updeep-standalone.min.js',
minify: true,
env: 'production',
});
return gulp.src('lib/index.js')