Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Include frameworks in main-app" #41997

Merged
merged 1 commit into from Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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