Skip to content

Fix/vite manifest transitive css - #128

Merged
benkhalife merged 3 commits into
masterfrom
fix/vite-manifest-transitive-css
Sep 25, 2026
Merged

benkhalife merged 3 commits into
masterfrom
fix/vite-manifest-transitive-css

Conversation

@benkhalife

Copy link
Copy Markdown
Member

No description provided.

Rollup can fold a CSS-only entry into a shared chunk that a sibling
entry only "imports" rather than owning a direct "css" key of its
own (e.g. two Vite entries importing the exact same CSS module).
renderProductionTags() only read the entry's own manifest "css" key,
so the imported entry silently lost its stylesheet <link> tag in
production builds even though the CSS file was built and present.

Walk the manifest's "imports" chain recursively (with cycle/dedup
guards) to collect CSS owned by any chunk the entry depends on.
9 tests: collectCss() direct/transitive/deduped/cyclic-safe collection
in isolation via reflection, plus end-to-end assets() checks against a
manifest fixture reproducing the shared-chunk scenario.
@benkhalife
benkhalife merged commit 9de65d3 into master Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant