You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In webpack 5 the syntax used is no longer able to statically evaluated which requires dependency tracing solutions to guess which files are needed in the relative directory used usually causing entire directories that aren't needed to be marked as needed e.g. the entire .next/serverless/pages directory is being included from the below require.
// "1" is the signal for "already loaded"/******/if(!installedChunks[chunkId]){/******/if(true){// all chunks have JS/******/installChunk(require("../../"+__webpack_require__.u(chunkId)));/******/}elseinstalledChunks[chunkId]=1;/******/}
Expected Behavior
To be able to trace and include only the needed files in webpack 5 the same way we were able to in webpack 4
To Reproduce
Use webpack 5 with a dependency tracing solution like node-file-trace to detect needed files
The text was updated successfully, but these errors were encountered:
This updates to output server chunks to a nested folder to prevent bundling the entire folder when tracing. This also fixes the webpack 5 tests not actually using webpack 5 since #22583 since the webpack 5 enabling check didn't account for the test environment variable used to enable webpack 5. This also clears up some deprecation warnings from webpack 5 in the mini-css-extract-plugin.
Fixes: #21297
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
10.0.5 (canary as well)
What version of Node.js are you using?
v12.20.0
What browser are you using?
all
What operating system are you using?
macOS, Linux, Windows
How are you deploying your application?
Vercel
Describe the Bug
When dynamic imports are used dynamic chunks are created for the server build and dynamic required.
In webpack 4 the syntax used to require these dynamic chunks was able to be statically evaluated:
In webpack 5 the syntax used is no longer able to statically evaluated which requires dependency tracing solutions to guess which files are needed in the relative directory used usually causing entire directories that aren't needed to be marked as needed e.g. the entire
.next/serverless/pages
directory is being included from the below require.Expected Behavior
To be able to trace and include only the needed files in webpack 5 the same way we were able to in webpack 4
To Reproduce
Use webpack 5 with a dependency tracing solution like
node-file-trace
to detect needed filesThe text was updated successfully, but these errors were encountered: