Is there a way to monitor a folder containing less files and only compile the "styles.less" file when changes are made, even if other less files such as "header.less" or "navigation.less" have been modified? I've set up 2 tasks for this purpose. The task "watchless" works fine and compiles styles.less to styles.css as expected. However, if an error occurs while editing a less file, the watcher stops functioning despite using gulp-plumber. How can I resolve this issue?
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var less = require('gulp-less');
var watch = require('gulp-watch');
var path_less = 'templates/responsive/css/less/';
var path_css = 'templates/responsive/css/';
gulp.task('less2css', function () {
return gulp.src(path_less + 'styles.less')
.pipe(plumber())
.pipe(less())
.pipe(gulp.dest(path_css))
});
gulp.task('watchless', function() {
gulp.watch(path_less + '*.less', ['less2css']); // Watch all the .less files, then run the less task
});