Skip to content

Commit

Permalink
Add error handling to "scripts" and "styles" gulp tasks
Browse files Browse the repository at this point in the history
Thanks, MWDelaney, Nicolo_Sacchi and epiphron!
  • Loading branch information
MWDelaney authored and TobiasKjrsgaard committed Feb 7, 2017
1 parent bec9e9c commit d67b65d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ var enabled = {
// Path to the compiled assets manifest in the dist directory
var revManifest = path.dist + 'assets.json';

// Error checking; produce an error rather than crashing.
var onError = function(err) {
console.log(err.toString());
this.emit('end');
};

// ## Reusable Pipelines
// See https://github.com/OverZealous/lazypipe

Expand Down Expand Up @@ -177,6 +183,7 @@ gulp.task('styles', ['wiredep'], function() {
});
}
merged.add(gulp.src(dep.globs, {base: 'styles'})
.pipe(plumber({errorHandler: onError}))
.pipe(cssTasksInstance));
});
return merged
Expand All @@ -191,6 +198,7 @@ gulp.task('scripts', ['jshint'], function() {
manifest.forEachDependency('js', function(dep) {
merged.add(
gulp.src(dep.globs, {base: 'scripts'})
.pipe(plumber({errorHandler: onError}))
.pipe(jsTasks(dep.name))
);
});
Expand Down

0 comments on commit d67b65d

Please sign in to comment.