Add an extra argument {cwd:'./'}
in gulp.watch
:
// gulpfile.js
gulp.watch('src/js/**/*.js', {cwd:'./'}, ['scripts']);
Note!
- Avoid
./
in the file/folder patterns - Ensure
./
in the value for cwd
Credits: stackoverflow.com
Add an extra argument {cwd:'./'}
in gulp.watch
:
// gulpfile.js
gulp.watch('src/js/**/*.js', {cwd:'./'}, ['scripts']);
Note!
./
in the file/folder patterns./
in the value for cwdCredits: stackoverflow.com