Gulp watch fire task only on added or deleted
See original GitHub issueIs there a way to only trigger a task upon a particular set of event types. e.g. added
or deleted
?
gulp.watch(`/path/to/new/files**/*`, (event) => {
if (event.type === 'added' || event.type === 'deleted') {
// fire some gulp task
}
});
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
gulp.watch trigger only when files are added or deleted but not ...
I want to fire off a task only when files are added or deleted but not changed. I have the watch gulp.watch(['src/App/**/ ...
Read more >watch() - gulp.js
name type default
ignoreInitial boolean true
delay number 200
queue boolean true
Read more >Building a Gulp workflow wrapped around Jekyll
An attempt at adding more dynamism to Jekyll via a workflow revamp using Gulp as a task runner and BrowserSync as a local...
Read more >Browsersync + Gulp.js
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >How To Build And Develop Websites With Gulp
In other words, if you run a task that requires only two plugins, it won't load all of the plugins that the other...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On Gulp 3.8 and 3.9 is only triggering ‘changed’ and ‘deleted’ files if your source start with ‘./’ without ‘./’ triggering also ‘added’.
Gulp 4.0 not tested.
Using Mac OSX El Capitan
Chalking this up to #651 for 3.9 - However, I think you can use the returned watcher to listen on events, I’m not sure how accurate they are due to all the other problems. In gulp 4, you can use the returned watcher to listen for all events that chokidar emits.