Open jml6m opened 8 years ago
+1 getting the same issue here.
+1 Same here.
Seems to happen when watching file at project root path.
Below sample works as expected
grunt.initConfig({
watch: {
styles: {
files: ['styles/**/*'],
tasks: ['styleguide-generate'],
}
}
...
});
Running "watch" task
Waiting...
Verifying property watch exists in config...OK
Verifying property watch.styles.files exists in config...OK
Watching styles for changes
Watching styles/XXXXX for changes....
Watching styles/XXXXX for changes....
....
Adding README.md to watch list produce more watch than expected:
grunt.initConfig({
watch: {
styles: {
files: ['styles/**/*', 'README.md'],
tasks: ['styleguide-generate'],
}
}
...
});
Running "watch" task
Waiting...
Verifying property watch exists in config...OK
Verifying property watch.styles.files exists in config...OK
Watching styles for changes.
Watching README.md for changes.
Watching .git for changes.
Watching bower_components for changes.
Watching docs for changes.
Watching styles/XXXXX for changes....
Watching styles/XXXXX for changes....
....
Thanks @emri99, was also experiencing this bug and that fixed it for me. The trick seems to be changing a glob like this: styles/**
to this: styles/**/*
.
This is in my Gruntfile.js:
Yet when I run
grunt watch:dev -v
, it says it's watching all folders in my root:Changing code to
files: [ 'Gruntfile.js', '!node_modules/**' ]
doesn't matter, it still prints out that same list of "watching"