gulp watch: Task never defined: watch
after download and run npm install, i am trying run gulp watch, then getting this error ubuntu 18:04 nodejs v8.10.0 npp 6.9.0 gulp cli 2.2.0 local version 4.0.0
I found that this works. Add to gulpfile.js gulp.task('watch', watcher)
@Peteypete It seem to work for me, but the task seems to get stuck at some point :(
Had to switch to running gulp manually each time after changing gulp.task('default', buildCss), but still can't get gulp to watch for changes
@azinkey @Zhephard Hi, did you guys manage to do gulp watch eventually? I'm not exactly sure what is happening here.
After buildCss function I've change code like this and it works in gulp v4;
New one
gulp.task('watch', function () {
gulp.watch(['scss/*.scss'], gulp.series(buildCss));
});
gulp.task('default', gulp.series(buildCss, 'watch'));
Old one
function watcher() {
gulp.watch(['scss/*.scss'], gulp.series(buildCss));
}
exports.watch = gulp.series(buildCss, watcher);
exports.default = gulp.series(buildCss);