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 3b839ac734
commit f4ee02ad50
3 changed files with 17 additions and 8 deletions

View File

@ -267,6 +267,11 @@ Running Nailgun in Fake Mode
gulp build --static-dir=static_compressed
To speed up build process you may also want to disable uglification and
source maps generation::
gulp build --no-uglify --no-sourcemaps
* If you plan to modify Fuel UI, there is more convenient option --
a development server. It watches for file changes and automatically
rebuilds changed modules (significantly faster than full rebuild)

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;
}

View File

@ -270,15 +270,12 @@ function run_ui_func_tests {
pushd $ROOT/nailgun >> /dev/null
if [ $no_ui_compression -ne 1 ]; then
echo -n "Compressing UI... "
local output
output=$(${GULP} build --static-dir=$COMPRESSED_STATIC_DIR 2>&1)
echo "Compressing UI... "
${GULP} build --no-sourcemaps --static-dir=$COMPRESSED_STATIC_DIR
if [ $? -ne 0 ]; then
echo "$output"
popd >> /dev/null
return 1
fi
echo "done"
else
echo "Using compressed UI from $COMPRESSED_STATIC_DIR"
if [ ! -f "$COMPRESSED_STATIC_DIR/index.html" ]; then