A wrapper around gulp-watch with added features
Note: Not compatible with Gulp 4!
gulp-watch-now is available on Npm. You can add it to your Node.js project with a simple command.
npm install gulp-watch-now
'Require' gulp-watch-now into a variable and use it almost as you would use gulp-watch, passing in an array of files to watch and an array of tasks to run for changes in those files. You just have to pass the instance of gulp
as the first parameter.
gulp.task('develop', function () {
gulpWatchNow.watch(gulp, [
'src/index.js'
], [
'scripts-debug'
]);
});
The only motivation to use an extra package (this) and not use the already-available gulp-watch is that unlike the latter, the former runs all the supplied tasks once first and then every time the files in the specified patterns are changed. The latter only does it on file changes.