Persistent Cache Invalidation on Configuration Changes
0 reputation · 06 Feb 2021, 21:46 UTC
webpack 5 employs a persistent build cache stored in a .webpack directory by default, and its enhanced module resolver caches resolved paths to accelerate rebuilds. A documented behavior specifies that cache invalidation triggers on configuration changes rather than solely on file modifications, which can impact development workflow predictability. When cache.type is set to memory in development mode, the consistency of this invalidation across operating systems becomes uncertain due to differing file system event handling, and third-party loaders may bypass the built-in mechanism without notification.
- Does configuration-triggered invalidation propagate reliably across Windows, macOS, and Linux when cache.type is set to memory?
- How does module resolution caching interact with persistent build cache when watch mode detects configuration file modifications?
- What is the observed variance in rebuild time when invalidation is triggered by configuration changes versus file changes in otherwise identical project structures?