Skip to content

Document updated gulp.watch syntax for gulp 4.0 #925

@kincaidoneil

Description

@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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions