From 4f5ae94b62b0e949adda5a5e2672cc79a193c02d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 Sep 2020 12:14:37 +0300 Subject: [PATCH] prevent source errors from crashing gulp watch --- gulpfile.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 97f7443d1..e04cc85d0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,11 +2,18 @@ const gulp = require('gulp'); const less = require('gulp-less'); +function swallowError(error) { + console.log(error.toString()) + + this.emit('end') +} + gulp.task('less', function(cb) { gulp .src(['themes/compact.less', 'themes/compact_night.less', 'themes/light.less', 'themes/night_blue.less', 'themes/night.less']) .pipe(less()) + .on('error', swallowError) .pipe( gulp.dest(function(f) { return f.base;