I've got a task:
gulp.task('assetsInject', function () {
gulp.src(paths.index)
.pipe(plugins.inject(
gulp.src(paths.scripts, {read: false}),
{
addRootSlash: false
}
))
.pipe(gulp.dest(paths.static))
});
and want it to run on new *.js files created or deleted:
gulp.task('watch', function () {
plugins.watch({glob: path.scripts}, function () {
gulp.start('assetsInject')
});
});
but gulp-watch starts task only when existing files were modified, not when new files were created.
Is it possible to start task after creation and deletion only, not when files were modified?