When using cache-loader configured with cacheContext under a webpack in watch and running a development configuration, it was expected to have the final bundles always in sync with the changed source files.
Actual Behavior
In the above mentioned cache-loader version when cacheContext is used some relative paths are being used when calling this.fs.stat. That call would sometimes return wrong stale metadata and the cache-loader would return the cached results for that file instead of the ones newly changed on disk.
How Do We Reproduce?
Just use the mentioned cache-loader version in a simple application configured with webpack in watch mode running a development configuration. Start changing the source files and you'll see that sometimes, despite having webpack running the compilation, the bundles are not updated correctly with the last changes on disk.
Expected Behavior
When using
cache-loader
configured withcacheContext
under a webpack inwatch
and running a development configuration, it was expected to have the final bundles always in sync with the changed source files.Actual Behavior
In the above mentioned cache-loader version when
cacheContext
is used some relative paths are being used when callingthis.fs.stat
. That call would sometimes return wrong stale metadata and the cache-loader would return the cached results for that file instead of the ones newly changed on disk.How Do We Reproduce?
Just use the mentioned
cache-loader
version in a simple application configured with webpack in watch mode running a development configuration. Start changing the source files and you'll see that sometimes, despite having webpack running the compilation, the bundles are not updated correctly with the last changes on disk.This is a bug fixed by https://github.com/webpack-contrib/cache-loader/pull/83 but we might want to further investigate the cause for this directly in webpack/webpack dependencies that's why I'm opening that issue.
/CC @evilebottnawi