How to setup gulp watch?

Here are the contents of the file main.less:

@import "../blocks/simple.less";

@import "../blocks/header.less";
@import "../blocks/slider.less";
@import "../blocks/sets.less";
@import "../blocks/help.less";
@import "../blocks/category.less";
@import "../blocks/tour.less";
@import "../blocks/recall.less";
@import "../blocks/review.less";
@import "../blocks/footer.less";

@import "../blocks/device.less";


Here is Tasca:
gulp.task(init.name+':less', function () {

 return gulp.src(init.less)
.pipe(less())
.pipe(autoprefixer())
.pipe(cssmin())
.pipe(gulp.dest(init.css.assets))
});

 gulp.task(init.name+':watch', function(){

 watch(init.watch.less[0], function(event, cb) {
gulp.start([init.name+':less']);
});

 });


1. start the watch, she monitors changes in the file main.less
and files in it (written in the beginning)

2. change less, and keep

3. the changes are visible on the website (watch finished successfully)

4. trying again to change less

5. the changes do not apply, less is not compiled, although the watch command executes, why? in other words I have a disposable watch
June 5th 19 at 21:52
2 answers
June 5th 19 at 21:54
I use. I don't know about correctness, but it works.
gulp.task("serve", function () {
browserSync.init({
 server: "dev"
});

 gulp.watch("src/scss/*.scss", ["dev:scss"]);
 gulp.watch("src/**/*.html", ["dev:html"]);
 gulp.watch("src/js/*.js", ["dev-js"]);
 gulp.watch("src/js/libs/*.js", ["dev:js-libs"]);
 gulp.watch("dev/*.html").on("change", browserSync.reload);
 gulp.watch("dev/js/*.js").on("change", browserSync.reload);
 gulp.watch("dev/**/*.css").on("change", browserSync.reload);
});
works as a disposable, LEss cache inlude how to disable this cache ? - Narciso commented on June 5th 19 at 21:57
June 5th 19 at 21:56
LEss cache inlude how to disable this cache ?
Do not write your own answers.
Edit your question. - Narciso commented on June 5th 19 at 21:59

Find more questions by tags Gulp.jsLess