I\'m having a problem with gulp
. I run gulp-watch
along with gulp-less
and gulp-clean
. Everything is running perfectly.
I have just set this up for my own personal project. According to the Gulp docs, you can just use gulp.watch
:
gulp.task('watch', function() {
gulp.watch('src/main/webapp/styles/**/*.{less, css}', ['less'])
.on('error', gutil.log);
});
EDIT: If this doesn't help, change your less
task to:
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'))
.on('error', gutil.log);
});
Adapted from this comment.