Skip to content

Commit

Permalink
Revert "Include frameworks in main-app" (#41997)
Browse files Browse the repository at this point in the history
Reverts #41465

This resolves #41870, will investigate and reopen a better solution to
reduce number of loaded chunks in the future.
  • Loading branch information
shuding committed Oct 27, 2022
1 parent 2e9e54b commit b512f8d
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1427,25 +1427,10 @@ export default async function getBaseWebpackConfig(
// and all other chunk depend on them so there is no
// duplication that need to be pulled out.
chunks: (chunk: any) =>
!/^(polyfills|main|main-app|pages\/_app)$/.test(chunk.name),
!/^(polyfills|main|pages\/_app)$/.test(chunk.name),
cacheGroups: {
framework: {
chunks: (chunk) => {
const name = chunk.name

// Skip app directory and include shared modules in main-app.
if (
name &&
hasAppDir &&
(name === 'main-app' ||
name === 'app-internals' ||
name.startsWith('app/'))
) {
return false
}

return true
},
chunks: 'all',
name: 'framework',
test(module: any) {
const resource = module.nameForCondition?.()
Expand Down

0 comments on commit b512f8d

Please sign in to comment.