`gulp.watch()` and the initial run
See original GitHub issueIt’d be nice to allow starting an initial run for a gulp watch, e.g.:
gulp.task('watch', function() {
return gulp.watch(['src/**/*.js', 'test/**/*.js'], {initialRun: true}, ['test.unit']);
});
Currently the only way to achieve this is to manually trigger a gulp.start
, which is undocumented and thus a bit ugly.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Watching Files | gulp.js
The watch() API connects globs to tasks using a file system watcher. ... If the task doesn't signal Async Completion, it will never...
Read more >Gulp Watch only run once - Stack Overflow
I'm changing files, but watch is only executed the first time I change a file. E.g. if I start gulp watch , change...
Read more >Gulp - Watch - Tutorialspoint
Gulp - Watch, The Watch method is used to monitor your source files. When any changes to the source file is made, the...
Read more >Watch for Changes > Gulp! Refreshment for ... - SymfonyCasts
Gulp will run all the "dependent tasks" first, then call your function. Handy! So if we just run gulp , it runs the...
Read more >Gulp Watch Example - Code Review Videos
This Gulp Watch example will help you! ... file) to ' watch ', and then we provide an array of tasks to run...
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
When I understand your problem correctly, maybe this would help you:
With this code, all tasks in the square brackets will start before the watch task. here is no need to use
gulp.start
3.x is feature locked and the file watcher is completely different in 4.0 where we just wrap chokidar. We don’t want to add extra functionality on top of chokidar.