webpack-contrib / cache-loader

[DEPRECATED] Caches the result of following loaders on disk
MIT License
637 stars 51 forks source link

Always use absolute paths after reading from cache #83

Closed mistic closed 5 years ago

mistic commented 5 years ago

We only want to use relative paths when writing to cache with a cacheContext. In all the other cases, right after reading from cache, we should always use absolute paths or the webpack watch will break in very strange ways (probably because a bug in chokidar/watchpack). In that case, using a relative path with this.fs.stat (the fs cached version from the webpack compiler) would return stale metadata.

/CC @evilebottnawi

mistic commented 5 years ago

@evilebottnawi I've made the changes you request, could you review the PR please?

alexander-akait commented 5 years ago

Can we open issue in https://github.com/webpack/memory-fs?

mistic commented 5 years ago

@evilebottnawi I've opened an issue here https://github.com/webpack-contrib/cache-loader/issues/86 if u want to proceed with further investigation in the underlying dependencies