Unverified Commit d393f07e authored by Shu Ding's avatar Shu Ding Committed by GitHub

Enable Webpack compression for dev (#53430)

As explained in the comments, for local development, we still want to compress the cache files individually to avoid I/O bottlenecks as we are seeing 1~10 seconds of FS I/O time from user reports.
parent b4d40f45
...@@ -2697,9 +2697,11 @@ export default async function getBaseWebpackConfig( ...@@ -2697,9 +2697,11 @@ export default async function getBaseWebpackConfig(
// - next.config.js keys that affect compilation // - next.config.js keys that affect compilation
version: `${process.env.__NEXT_VERSION}|${configVars}`, version: `${process.env.__NEXT_VERSION}|${configVars}`,
cacheDirectory: path.join(distDir, 'cache', 'webpack'), cacheDirectory: path.join(distDir, 'cache', 'webpack'),
// 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.
compression: false, // For local development, we still want to compress the cache files individually to avoid I/O bottlenecks
// as we are seeing 1~10 seconds of fs I/O time from user reports.
compression: dev ? 'gzip' : false,
} }
// Adds `next.config.js` as a buildDependency when custom webpack config is provided // Adds `next.config.js` as a buildDependency when custom webpack config is provided
......
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