From d0b120cc1cff5694832d1df0cc83dc2b231fe24d Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Wed, 30 Nov 2022 00:09:54 +0100 Subject: [PATCH] fix --- packages/next/build/entries.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/next/build/entries.ts b/packages/next/build/entries.ts index 19a6c5208e9d35b..fd4cee98cbf1c62 100644 --- a/packages/next/build/entries.ts +++ b/packages/next/build/entries.ts @@ -517,9 +517,9 @@ export function finalizeEntrypoint({ } } - const isAppEntry = + const isAppLayer = hasAppDir && - ([CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].includes(name) || + (name === CLIENT_STATIC_FILES_RUNTIME_MAIN_APP || entry.import.includes('next-flight-client-entry-loader')) if ( @@ -533,10 +533,10 @@ export function finalizeEntrypoint({ ].includes(name) ) { // TODO-APP: this is a temporary fix. @shuding is going to change the handling of server components - if (hasAppDir && entry.import.includes('next-flight-client-entry-loader')) { + if (isAppLayer) { return { dependOn: CLIENT_STATIC_FILES_RUNTIME_MAIN_APP, - layer: isAppEntry ? WEBPACK_LAYERS.appClient : undefined, + layer: WEBPACK_LAYERS.appClient, ...entry, } } @@ -550,7 +550,7 @@ export function finalizeEntrypoint({ } } - if (isAppEntry) { + if (isAppLayer) { return { layer: WEBPACK_LAYERS.appClient, ...entry,