Unverified Commit 8220976d authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

fixes a problem with cache invalidation (#58079)

### What?

fixes a problem with cache invalidation when the next.js folder moves in node_modules, but the version stays equal

### Why?

This can happen when pnpm creates a new next.js copy with different peerDependencies.
parent 99e584c7
...@@ -1945,9 +1945,10 @@ export default async function getBaseWebpackConfig( ...@@ -1945,9 +1945,10 @@ export default async function getBaseWebpackConfig(
// Disable memory cache in development in favor of our own MemoryWithGcCachePlugin. // Disable memory cache in development in favor of our own MemoryWithGcCachePlugin.
maxMemoryGenerations: dev ? 0 : Infinity, // Infinity is default value for production in webpack currently. maxMemoryGenerations: dev ? 0 : Infinity, // Infinity is default value for production in webpack currently.
// Includes: // Includes:
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
// - Next.js version // - Next.js version
// - next.config.js keys that affect compilation // - next.config.js keys that affect compilation
version: `${process.env.__NEXT_VERSION}|${configVars}`, version: `${__dirname}|${process.env.__NEXT_VERSION}|${configVars}`,
cacheDirectory: path.join(distDir, 'cache', 'webpack'), cacheDirectory: path.join(distDir, 'cache', 'webpack'),
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually. // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole. // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment