BuildDependencies in cache not update
See original GitHub issueBug report
What is the current behavior?
I’m using webpack to bundle my project, if BuildDependencies
in cache configuration is updated but the cache pack is not invalid, the pack will not updated.
If the current behavior is a bug, please provide the steps to reproduce. Use this repo: https://github.com/killagu/webpack-cache-bug/
- Run
npm run build
- Run
npm run build2
The cache will not update.
What is the expected behavior?
Update the cache to ensure all BuildDependencies
will be checked in next bundle.
Other relevant information: webpack version: 5.48.0 Node.js version: v14.16.0 Operating System: MacOS Additional tools:
How to fix it?
// https://github.com/webpack/webpack/blob/main/lib/cache/PackFileCacheStrategy.js#L1116
- if (!pack.invalid) return;
this.logger.log(`Storing pack...`);
let promise;
const newBuildDependencies = new Set();
for (const dep of this.newBuildDependencies) {
if (!this.buildDependencies.has(dep)) {
newBuildDependencies.add(dep);
}
}
+ if (!pack.invalid && !newBuildDependencies.size) return;
If it’s right, I’m glad to fix it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Automatically refresh caches when build dependencies are ...
In this blog post, we are sharing a solution that can help to invalidate and refresh the cache automatically whenever there is a...
Read more >Having trouble with Gradle dependencies not updating
I build and install one of the common jars, and the maven repo has it, but the Gradle cache still has a jar...
Read more >Updating a dependency is not invalidating other application's ...
When updating a shared library, it's not invalidating the cache of projects that depend on that library. I am updating a component called...
Read more >Pipelines caches with node does not refresh dependencies ...
The cache does not update. Upon build and install it works because the local node_modules gets updated, but the cached version doesn't get...
Read more >Caching Dependencies - CircleCI
Caching is one of the most effective ways to make jobs faster on CircleCI. ... Automatic dependency caching is not available in CircleCI,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Anyway let’s mark it as enhancement
Deleting build dependencies is not valid. They have to stay in the cache, since cache entries have been created with these build dependencies.