From ceff3186e22ddd08ce91ac8c34c352eab4b3befa Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Thu, 27 Oct 2022 12:33:29 -0700 Subject: [PATCH] Revert "Include frameworks in main-app (#41465)" This reverts commit a75b32387741088a808b0e1c0f06040489fd3a86. --- packages/next/build/webpack-config.ts | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index a51abb5acbac95d..bc90b23a0eace38 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?.()