I'm running the following watch task:
gulp.task('watch', function() {
gulp.watch('./ui/scss/*.scss', ['styles']);
gulp.watch('./js/*.js', '!./js/vendor/*.js', ['scripts']);
gulp.watch('./**/*.html', ['html']);
});
But it seems to throw the following error?...
TypeError: Cannot assign to read only property 'mark' of !./js/vendor/*.js at new Gaze
You need brackets around the paths if you want to specify multiple. Try the following for your second watch:
gulp.watch(['./js/*.js', '!./js/vendor/*.js'], ['scripts']);
gulp.watch
handles the file argument the same as vinyl-fs
. So you can use all the features specified in their documentation in gulp.watch
as well.
the second parameter of the watch must declare as array
gulp.watch('src...', ['taskname', ......];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With