Answer the question
In order to leave comments, you need to log in
Gulp, how to start a task for rebuilding when deleting a file with watch?
Good evening!
I don’t understand why it doesn’t perform the task when it is deleted.
console.log is executed when the file is deleted, but how can the task be restarted for reassembly?
gulp.watch('./source/**/*.{styl,css}', gulp.series('style')).on('unlink', function() {
return gulp.series('style');
});
Answer the question
In order to leave comments, you need to log in
If I understand your code correctly, then you need a command gulp.start("Task name")
Something like this...
gulp.watch('./source/**/*.{styl,css}', gulp.series('style')).on('unlink', function() {
gulp.start("rebuild");
return gulp.series('style');
});
The standard gulp.watch does not know how to watch new or deleted files. Try using gulp-watch
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question