I\'m having a problem with gulp
. I run gulp-watch
along with gulp-less
and gulp-clean
. Everything is running perfectly.
It works now! Here is my final, and working, gulp-less
task:
gulp.task('less', function() {
return gulp.src(['src/main/webapp/styles/main.less'], {base: 'src/main/webapp/styles/'})
.pipe(less().on('error', function(err){
gutil.log(err);
this.emit('end');
}))
.pipe(gulp.dest('src/main/webapp/styles/build'))
});
The problem was that, when there was an error in the LESS
the task still went on and built the destination file. On top of that I placed the error logging function and the emit('end')
as a callback to gulp.dest
.
Now, when the callback of less()
is the error log and emit('end')
everything works perfectly.