theme-kit icon indicating copy to clipboard operation
theme-kit copied to clipboard

gulp watch: Task never defined: watch

Open azinkey opened this issue 6 years ago • 4 comments

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

azinkey avatar May 27 '19 06:05 azinkey

I found that this works. Add to gulpfile.js gulp.task('watch', watcher)

Peteypete avatar Jun 16 '19 01:06 Peteypete

@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

esilva88 avatar Jun 24 '19 14:06 esilva88

@azinkey @Zhephard Hi, did you guys manage to do gulp watch eventually? I'm not exactly sure what is happening here.

yansusanto avatar Apr 13 '20 03:04 yansusanto

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);

skotancilar avatar Nov 24 '20 09:11 skotancilar