Document updated gulp.watch syntax for gulp 4.0
Created by: kincaidoneil
I recently updated to the 4.0 branch, however, I'm experiencing an issue in which using a function as a callback to gulp.watch
results in nothing being based through to the event
variable, as I particularly use event.path
.
Here's my code:
gulp.watch('app/index.html', function(event) {
console.log(event);
console.log(event.path);
});
Here's what the console returns after the file is updated:
[Function: done]
undefined
Even if I pass through gulp.series('name_of_task_here')
, it passes through the same thing to the first parameter.
Is there anything I'm doing wrong/was this method deprecated in gulp 4.0? If so, is there a better alternative?
Thanks!