-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
watch doesn't have same negation as src/dest (v4.0) #2192
Comments
Try setting the negated glob(s) first in the array |
That might solve this small example but it's still not the same as our negation logic (which happens in sequential order). Would you be willing to accept changes to that? |
I’m not sure whether my suggestion will solve this case, but anyway yes I would accept contributions to improve it. |
Hi, const watched = ['!docs/gulpfile.js', 'docs/**/*' ]; In that case, I see that gulp.src() also shows that the 'docs/gulpfile.js' is not excluded, possibly this is the normal logic of gulp. Is it correct? |
Let me share a couple of things that I found in my testing with gulp.watch() glob patterns. Test pattern: '!docs/{aa,_bb}'gulp.watch() does not triggers on 'aa', 'bb', 'aa/**/*', 'bb/**/*' --> vs. expecting only 'aa' and 'bb' to be excluded Test pattern: 'docs/data'gulp.watch triggers on changes of file 'data' (including create and delete), but does not triggers on directory 'data' (create, delete).
|
@shnam7 basically everything you are pointing out is related to chokidar - please open issues for them at https://github.com/paulmillr/chokidar I've labelled this issue with upstream because your issues might already be documented on their issue tracker. I've labelled it help wanted because none of the gulp team has direct access to that repo so we're in the same boat as you and none of us have much time to try to upstream your fixes. |
OK, thanks. That's good!! |
We've just added a Bug Bounty of $200 on this issue if anyone wants to solve it. |
Our first bug bounty has been claimed 🎉🙌 That was super quick! This was released as a patch release in glob-watcher. Update your dependencies (remember to deal with any package-locks) to get the fix. |
What were you expecting to happen?
gulp.watch() glob should work with exclude expression (ex: !docs/gulpfile.js)
What actually happened?
qulp.watch() is triggered even with the exclude expression.
Please post a sample of your gulpfile (preferably reduced to just the bit that's not working)
In this example, gulp.src() shows correct file list which is not including 'docs/gulpfile.js', but gulp.watch() triggers when I make changes on 'docs/gulpfile.js'
What version of gulp are you using?
gulp 4.0.0
What versions of npm and node are you using?
node 10.4.1
The text was updated successfully, but these errors were encountered: