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:
parent
32f69339a5
commit
b1701b09bd
@ -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(
|
||||||
compressor: {
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
screw_ie8: true,
|
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;
|
return config;
|
||||||
|
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user