From 87e01ccf0e22c2e359d90e78a5fde66a656e930c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 30 Jun 2023 05:25:43 +0100 Subject: [PATCH] fix(nuxt): handle injecting multiple entry ids for styles (#21864) --- packages/nuxt/src/core/runtime/nitro/renderer.ts | 15 +++++++++------ packages/vite/src/vite.ts | 4 ++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 3cc1bc37c4..840e01281a 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -66,7 +66,10 @@ const getClientManifest: () => Promise = () => import('#build/dist/ser .then(r => r.default || r) .then(r => typeof r === 'function' ? r() : r) as Promise -const getEntryId: () => Promise = () => getClientManifest().then(r => Object.values(r).find(r => r.isEntry)!.src!) +const getEntryIds: () => Promise = () => getClientManifest().then(r => Object.values(r).filter(r => + // @ts-expect-error internal key set by CSS inlining configuration + r._globalCSS +).map(r => r.src!)) // @ts-expect-error virtual file const getStaticRenderedHead = (): Promise => import('#head-static').then(r => r.default || r) @@ -289,11 +292,11 @@ export default defineRenderHandler(async (event): Promise