From df1b47cee53185e3ab79177c4e079ba4997e7e6d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 9 Oct 2014 18:57:06 +0200 Subject: [PATCH] Better build error handling for uglify and sass --- build/gulpfile.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build/gulpfile.js b/build/gulpfile.js index ed29afc..d89522f 100644 --- a/build/gulpfile.js +++ b/build/gulpfile.js @@ -1,7 +1,7 @@ var gulp = require('gulp'), plugins = require("gulp-load-plugins")(); -paths = { +var paths = { view: [ 'bower_components/jQuery/dist/jquery.min.js', 'bower_components/js-md5/js/md5.min.js', @@ -23,7 +23,14 @@ paths = { ] } -gulp.task('view', function () { +var catchError = function(err) { + + console.log(err.toString()); + this.emit('end'); + +} + +gulp.task('view', function() { gulp.src(paths.view) .pipe(plugins.concat('view.js', {newLine: "\n"})) @@ -32,19 +39,21 @@ gulp.task('view', function () { }); -gulp.task('js', function () { +gulp.task('js', function() { gulp.src(paths.js) .pipe(plugins.concat('main.js', {newLine: "\n"})) .pipe(plugins.uglify()) + .on('error', catchError) .pipe(gulp.dest('../assets/min/')); }); -gulp.task('css', function () { +gulp.task('css', function() { gulp.src(paths.css) .pipe(plugins.sass()) + .on('error', catchError) .pipe(plugins.concat('main.css', {newLine: "\n"})) .pipe(plugins.autoprefixer('last 4 versions', '> 5%')) .pipe(plugins.minifyCss())