From c54d058d6f838072ba92cc6c10c0c021c7893a5d Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Thu, 8 Jun 2023 14:17:38 +0200 Subject: [PATCH] drop chunks field in the client manifest for ssr --- .../src/build/webpack/plugins/flight-manifest-plugin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts b/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts index 85f321877c863..66c3224d3b2ce 100644 --- a/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts +++ b/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts @@ -307,6 +307,10 @@ export class ClientReferenceManifestPlugin { moduleIdMapping[id] = moduleIdMapping[id] || {} moduleIdMapping[id][name] = { ...manifest.clientModules[exportName], + // During SSR, we don't have external chunks to load on the server + // side with our architecture of Webpack / Turbopack. We can keep + // this field empty to save some bytes. + chunks: [], id: pluginState.serverModuleIds[ssrNamedModuleId], } } @@ -318,6 +322,10 @@ export class ClientReferenceManifestPlugin { edgeModuleIdMapping[id] = edgeModuleIdMapping[id] || {} edgeModuleIdMapping[id][name] = { ...manifest.clientModules[exportName], + // During SSR, we don't have external chunks to load on the server + // side with our architecture of Webpack / Turbopack. We can keep + // this field empty to save some bytes. + chunks: [], id: pluginState.edgeServerModuleIds[ssrNamedModuleId], } }