From f14409ca64b224b3f26a608ba7122de01245adf7 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 21 Dec 2022 17:47:48 +0100 Subject: [PATCH] update for changes in app manifests --- crates/next-core/js/src/entry/app-renderer.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/next-core/js/src/entry/app-renderer.tsx b/crates/next-core/js/src/entry/app-renderer.tsx index 9a645b1a05d73..d7844e257405c 100644 --- a/crates/next-core/js/src/entry/app-renderer.tsx +++ b/crates/next-core/js/src/entry/app-renderer.tsx @@ -112,7 +112,7 @@ async function runOperation(renderData: RenderData) { const pageModule = pageItem.page!.module; const Page = pageModule.default; let tree: LoaderTree = ["", {}, { page: [() => Page, "page.js"] }]; - layoutInfoChunks["page.js"] = pageItem.page!.chunks; + layoutInfoChunks["page"] = pageItem.page!.chunks; for (let i = LAYOUT_INFO.length - 2; i >= 0; i--) { const info = LAYOUT_INFO[i]; const components: ComponentsType = {}; @@ -122,7 +122,7 @@ async function runOperation(renderData: RenderData) { } const k = key as FileType; components[k] = [() => info[k]!.module.default, `${k}${i}.js`]; - layoutInfoChunks[`${k}${i}.js`] = info[k]!.chunks; + layoutInfoChunks[`${k}${i}`] = info[k]!.chunks; } tree = [info.segment, { children: tree }, components]; } @@ -146,9 +146,7 @@ async function runOperation(renderData: RenderData) { return manifest; } if (name === "__entry_css_files__") { - return { - page: layoutInfoChunks["page.js"], - }; + return __entry_css_files__; } return new Proxy({}, proxyMethodsForModule(name as string, css)); }, @@ -156,11 +154,13 @@ async function runOperation(renderData: RenderData) { }; const manifest: FlightManifest = new Proxy({} as any, proxyMethods(false)); const serverCSSManifest: FlightCSSManifest = {}; + const __entry_css_files__: FlightManifest["__entry_css_files__"] = {}; for (const [key, chunks] of Object.entries(layoutInfoChunks)) { const cssChunks = chunks.filter((path) => path.endsWith(".css")); - serverCSSManifest[key] = cssChunks.map((chunk) => + serverCSSManifest[`${key}.js`] = cssChunks.map((chunk) => JSON.stringify([chunk, [chunk]]) ); + __entry_css_files__[key] = cssChunks; } serverCSSManifest.__entry_css_mods__ = { page: serverCSSManifest["page.js"],