Improve gulp on error

I’m using sass with ionic, but whenever I get an error with the sass compiler, it breaks everything, making me have to restart ionic serve

So I just added this into the gulp file, and now it gives a neat error and aborting, instead of breaking everything

var errorAlert;
gulp.task("sass", function(done) {
    .on("error", errorAlert)
      keepSpecialComments: 0
    .pipe(rename({ extname: ".min.css" }))
    .on("end", done);

errorAlert = function(err) {

Wouldn’t this do the same thing (but a bit simpler):

  errLogToConsole: true

That’s what’s in the gulpfile when you start, but it breaks whenever there’s an error

Okay I see, thanks, I’ll add your technique to my gulp file.

I actually asked this question a bit back because I was having the same issue. The blog post they wrote about it might help you too