Enable uglification by default

Also add new options to disable uglification and source maps
generation

Change-Id: I4c458abbf8bff9b9783c0cf0b46b45a96803101f
Partial-Bug: #1517028
This commit is contained in:
Vitaly Kramskikh 2015-12-07 16:40:29 +03:00
parent f651df717f
commit d9334bbded
1 changed files with 10 additions and 3 deletions

View File

@ -157,7 +157,7 @@ gulp.task('license', function(cb) {
if (errors.length) {
_.each(errors, function(error) {
gutil.log(gutil.colors.red(error.libraryName, 'has', error.license, 'license'));
})
});
cb('Issues with licenses found');
} else {
cb();
@ -276,11 +276,18 @@ gulp.task('build', function(cb) {
new webpack.optimize.DedupePlugin()
);
}
if (argv.uglify) {
if (argv.uglify !== false) {
config.devtool = 'source-map';
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})
new webpack.optimize.UglifyJsPlugin({
mangle: false,
compress: {warnings: false}
})
);
}
if (argv.sourcemaps === false) {
delete config.devtool;
}
if (argv.watch) {
config.watch = true;
}