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
This commit is contained in:
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; config.output.filename = options.filename;
if (options.minify) { if (options.minify) {
config.plugins.push(new webpack.optimize.UglifyJsPlugin({ config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: { compressor: {
screw_ie8: true, screw_ie8: true,
warnings: false,
}, },
})); })
);
}
if (options.env) {
config.plugins.push(
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(options.env),
},
})
);
} }
return config; return config;

View File

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