M
M
Mikhail Rudenko2015-01-14 22:18:18
gulp.js
Mikhail Rudenko, 2015-01-14 22:18:18

How to ignore errors in gulp?

I start writing an index on jade, if I write something wrong in the file, and it compiles, then galp knocks out an error in the console, and gulp watch ends, what should I do? Is there such a galp plugin that would allow compiling any files with errors ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Nalomenko, 2015-01-14
@balion

Add to your .pipe(jade({...}))sequence .on('error', gutil.log) .on('error', gutil.beep))after including gulp-util . Of course, the file will not be compiled to the end, but the watch process will not be terminated either. An error code will simply be logged, and this event will be accompanied by a sound notification. As soon as you fix the syntax error of the compiled jade, it will compile to the end.
More or less like this:

gulp.task('jade', function () {
  gulp.src('./src/jade/*.jade')
    .pipe(jade() .on('error', gutil.log) .on('error', gutil.beep))
    .pipe(gulp.dest('./public/html/'))
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question