Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp watch: Task never defined: watch #13

Open
azinkey opened this issue May 27, 2019 · 4 comments
Open

gulp watch: Task never defined: watch #13

azinkey opened this issue May 27, 2019 · 4 comments

Comments

@azinkey
Copy link

azinkey commented May 27, 2019

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

@Peteypete
Copy link

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

@esilva88
Copy link

@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

@yansusanto
Copy link

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

@skotancilar
Copy link

skotancilar commented Nov 24, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants