Skip to content

Commit

Permalink
UI-3211: Handle and display error object on uglification error (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
joristirado committed Oct 25, 2018
1 parent ba5653e commit ca6b1a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gulp/tasks/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ var paths = require('../paths.js');

gulp.task('minify-js', function() {
return gulp.src([paths.tmp + '/js/main.js', paths.tmp + '/js/templates.js'])
.pipe(uglify())
.pipe(uglify().on('error', handleUglifyError))
.pipe(gulp.dest(paths.tmp + '/js/'));
});

gulp.task('minify-js-app', function() {
return gulp.src(paths.app + 'app.js')
.pipe(uglify())
.pipe(uglify().on('error', handleUglifyError))
.pipe(gulp.dest(paths.app));
});

Expand All @@ -22,4 +22,8 @@ gulp.task('lint', function() {
return gulp.src(pathToLint)
.pipe(eslint())
.pipe(eslint.format());
});
});

function handleUglifyError(error) {
console.error(JSON.stringify(error, null, 4));
}

0 comments on commit ca6b1a4

Please sign in to comment.