gulp: Watch is very slow to recognize file modifications
This seems to be a common problem for me, but I haven’t been able to find any issues about posted about it. Maybe I’m just doing something wrong.
When I’m developing, it frequently takes the watch task 5-15 seconds just to recognize that a file was modified. Once the task actually starts, everything execute quickly, but the problem is triggering the watch task so it notices my file modifications. This makes development much slower than manually calling a particular task. Here’s my very simple watch task:
gulp.task('less', function() {
return gulp.src(paths.less)
.pipe(gulpless())
.pipe(gulp.dest('./public/css/tmp'));
});
gulp.task('watch', function() {
gulp.watch(paths.less, ['less']);
});
Is this normal behavior? If so, is there anything I can do to speed up the file modification recognition? If not, how can I benchmark what’s taking so long?
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 16 (1 by maintainers)
Commits related to this issue
- Set actimeo=2 for vagrant synced folders. Should result in processes like gulp detecting file changes faster. See https://github.com/gulpjs/gulp/issues/448 — committed to cameronmaske/docker-osx by cameronmaske 10 years ago
- add nfs actimeo option to vagrant synced folder this speeds up gulp watch significantly: https://github.com/gulpjs/gulp/issues/448 — committed to MESH-Research/commons-playbooks by modelm 8 years ago
@swvjeff,
Bit late to the party but I solved a similar issue by updating the
synced folder
options in my vagrantfile.By adding the
'actimeo=2'
I got the updates to happen almost instantly.Hope it helps, Rich.