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
Multiple DefinePlugin instances cause aggressive cache invalidation due to collisions #18328
Comments
Please create reproducible test repo, because I can't reproduce it, also |
Oh, the problem is here - https://github.com/shellscape/webpack-plugin-serve/blob/master/lib/index.js#L168, it is always a unique value, so webpack invalidates caches between multiple |
Interesting, will dig in a bit more. That said the following patch does seem to fix my issue
|
hm, we use |
Will do. I believe the issue was the value is stash into a map (on compiler I believe) that uses only the DefinePlugin_hash key (which has no uniqueness) |
|
Can you try to remove |
Cam u email me I do not know how to even access assets I need some truthful and trustworthy to help will u |
I'll close this issue. In the end it appears the cause by |
Bug report
When multiple instances of
DefinePlugin
are inserted into the compilation, constants unkeyed by an instance identifier (specificallyVALUE_DEP_PREFIX
andVALUE_DEP_MAIN
) cause inconsistent hash values causing massive cache invalidations (in our case makingwebpack
believe 90% of modules had changed on any file change).Although its uncommon for developers to use multiple instances of
DefinePlugin
, some plugins likewebpack-plugin-serve
automatically inject their own instances.What is the current behavior?
Multiple instances cause hash inconsistency causing all modules to be considered changed
What is the expected behavior?
The DefinePlugin hash should only change if the defineplugin inputs change
Other relevant information:
webpack version:
5.90.3
Node.js version:
v20.11.1
Operating System:
OSX
Additional tools:
The text was updated successfully, but these errors were encountered: