From d9334bbdeda77bb2de3e4ba44c47bf22f2a879ab Mon Sep 17 00:00:00 2001 From: Vitaly Kramskikh Date: Mon, 7 Dec 2015 16:40:29 +0300 Subject: [PATCH] Enable uglification by default Also add new options to disable uglification and source maps generation Change-Id: I4c458abbf8bff9b9783c0cf0b46b45a96803101f Partial-Bug: #1517028 --- gulpfile.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6b1871ac8..52ebf59d4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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; }