diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index a51abb5acbac..bc90b23a0eac 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -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?.()