Answer the question
In order to leave comments, you need to log in
How to throw an error when executing Gulp without stopping it?
Here is gulpfile.js
var gulp = require('gulp'),
less = require('gulp-less');
gulp.task('less', function() {
gulp.src('css/style.less')
.pipe(less())
.pipe(gulp.dest('css/'));
});
gulp.task('watch', function() {
gulp.watch('css/*.less', ['less']);
})
gulp.task('default', ['watch']);
Answer the question
In order to leave comments, you need to log in
i use gulp-plumber it catches errors and prints them to the terminal without stopping the task.
var gulp = require('gulp'),
less = require('gulp-less');
var plumber = require('gulp-plumber');
gulp.task('less', function() {
gulp.src('css/style.less')
.pipe(plumber())
.pipe(less())
.pipe(gulp.dest('css/'));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question