From 23fd02204ce667af45b136a9825e4747937b97b7 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Wed, 30 Jul 2025 11:19:20 +0900 Subject: [PATCH] fix(rsc): fix FOUC of lazy component css within client boundary --- packages/plugin-rsc/src/plugin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/plugin-rsc/src/plugin.ts b/packages/plugin-rsc/src/plugin.ts index a8b946ea..0db19b91 100644 --- a/packages/plugin-rsc/src/plugin.ts +++ b/packages/plugin-rsc/src/plugin.ts @@ -1495,6 +1495,8 @@ function collectAssetDepsInner( assert(v, `Not found '${k}' in the bundle`) if (v.type === 'chunk') { css.push(...(v.viteMetadata?.importedCss ?? [])) + // TODO: for client references, aggressively collect to surface css at client boundary for SSR. + v.dynamicImports for (const k2 of v.imports) { // server external imports is not in bundle if (k2 in bundle) {