I have a function that I want to apply to only the changed file with gulp 4.0 watcher e.g. the current task would be:
gulp.watch([
paths.sourceFolder + "/**/*.js",
paths.sourceFolder + "/**/*.html",
paths.sourceFolder + "/**/*.less",
paths.lessFolder + "/**/*.less",
], {}
).on('change', gulp.series(lint));
This works, gives output and when it fails e.g. lint errors it continues to watch for more changes. However when I try to reformat this to run just on the single file no matter what I do it simply falls over on error and doesn't give task detail output in the console e.g.
gulp.watch([
paths.sourceFolder + "/**/*.js",
paths.sourceFolder + "/**/*.html",
paths.sourceFolder + "/**/*.less",
paths.lessFolder + "/**/*.less",
], {}).on('change', (path) => {
lint(someDoneFunction, path)
});
How can I make this function run for a single file and retain the same output and error handling as using gulp.series()?