-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
watchOptions.ignored not working #1208
Comments
@websolutions-hamburg thanks for the report, and good catch. I went all the way back through the blame and couldn't figure out when these options were ever used. this commit e7c5452 seems to have added the option. It would appear that these are supposed to be used with the |
OK so webpack proper is using an org module called watchpack, which is massaging the options before it's passed to chokidar https://github.com/webpack/watchpack/blob/ebcdc813100168af1a61189403a8b1abfa5338a3/lib/DirectoryWatcher.js#L58 That's a hold-over from before the project started using chokidar. So we're going to have to update the docs for WDS, and also do the same massaging of options here in WDS (in addition to actually passing the options to chokidar) So there's some work to be done |
watchOptions isn't ignoring anything at all. We have a file that is generated before compile time and its triggering another recompile unfortunately. |
@jaunkst are you joining this issue to comment on a possibly-related issue, or the same symptoms in a different project? please remember it's best to be verbose.
in this context that's not actually true |
@shellscape I have looked deeper and have discovered what our issue was, and how to work around it. I think its a combination of a few things.
We are currently having to backdate the file when its generated. I was somewhat confused as to what was actually going on and assumed that somehow the ignored rule wasn't being applied. Anyways, I never got the ignore rule to actually work in this particular case and I realize that in this issue it is when watching the baseContent for changes. |
@jaunkst lots of solid info there. but I'm really confused - who is "we"? do you work with the original post author? |
@shellscape I do not work with the original author. I was referring to my team, sorry for the confusion. |
@jaunkst thanks for clarifying. wanted to make sure I was addressing folks the right way here. Given your discoveries, I think it would be prudent to take this issue up with watchpack first, and webpack second. That is of course, if |
@shellscape yep, thats what I was thinking. I ended up logging the onChanges event in watchpack to see what files where triggering the recompile. It was the generated file and add adding it to the watchOptions.ignored did nothing. I even tried passing the options down to webpack-dev-servers watch options as you mentioned and it didn't help either. So I am assuming that because it is an entry it isn't being ignored or another watcher is being applied to the entries. |
Waiting on CI to confirm the build and will publish when that's done running. |
@jaunkst Google brings me here with the same problem as you. After much searching I found the problem to be webpack/watchpack#25 "Files created right before watching starts make watching go into a loop" And solved it with https://github.com/egoist/time-fix-plugin |
I solved it with Linux Ubuntu 20.04.2 |
Code
Expected Behavior
Ignore all
*.html
files.Actual Behavior
Nothing will be ignored. I also checked the source code from webpack and webpack-dev-server and I didn't found a place where the configuration
watchOptions.ignored
will be used.For Bugs; How can we reproduce the behavior?
Start the dev-server with option
watchContentBase
and try to ignore watch some files from the content base.The text was updated successfully, but these errors were encountered: