Open ghost opened 9 years ago
I'm open to suggestions on how this should work. How did you get it to work with your less task?
Well I'm far from being a Gulp or Node.js expert. Just using it in my web development workflow.
Here is my less task if it can help you:
// CSS
gulp.task('less', function() {
return gulp.src(paths.less + '/style.less')
.pipe(plumber({errorHandler: onError}))
.pipe(less())
.pipe(autoprefixer('> 1%', 'last 2 versions', 'ie >= 8'))
.pipe(minifycss(minifyOptions))
.pipe(gulp.dest(paths.css));
});
// Watch
gulp.task('watch', function() {
// Watch .less files
gulp.watch(paths.less + '/**/*.less', ['less']);
// Watch .js files
gulp.watch(paths.jsDev + '/**/*.js', ['js']);
});
In this case if the less() call fails, the following pipe (autoprefixer) is not executed but the watch task keeps working. I'm handling the error the same way as with the jshint task so I guess the errors are not triggered the same way by the less plugin and your plugin.
Hi I have an issue with the fail reporter. My use case is that I want jshint to make the task fail so the following pipes and tasks are not executed but I am also using it inside a watch and I don't want the watch to stop working on failure. I've managed to reach that behaviour for less files but it doesn't work with jshint.
So basically on failure the "js" task shouldn't be executed but the watch should keep working.
But this is the output I get: