How can I cancel / stop the current current task in gulp?
My task:
gulp.task('scripts', function() { return gulp.src('js/main.js') .pipe(browserify({ transform: [to5ify] })) .pipe(gulp.dest('./dist')); });
It works in hours:
gulp.task('watch', function() { gulp.watch('js/**/*.js', ['scripts']); });
If I modify the js file, the task is done, this is good. But if I change another file during the execution of the task, the task does not stop and does not restart. How can i fix this?
The task takes an average of 20 seconds, and the described case often occurs
gulp gulp-watch
Denni007
source share