Reputation: 2645
Currently i'm using gulp watch
to automatically compile my files on update; but now i'm looking to pipe()
them to multiple other folders.
For example; on use of the gulp command; these commands run:
gulp.src(['public/js/*']).pipe(gulp.dest('www'));
gulp.src(['public/css/*']).pipe(gulp.dest('www'));
gulp.src(['public/js/*']).pipe(gulp.dest('platforms/browser/www'));
gulp.src(['public/css/*']).pipe(gulp.dest('platforms/browser/www'));
How do I run a pipe()
task when gulp watch
notices a file change?
Upvotes: 2
Views: 186
Reputation: 404
Try floatdrop/gulp-watch:
var watch = require('gulp-watch');
watch('public/js/*', function () {
gulp.src('public/js/*')
.pipe(gulp.dest('www'));
});
Upvotes: 2