Skip to content

[unplugin] Fix Vite 8 CSS duplication#1547

Open
skovhus wants to merge 2 commits intofacebook:mainfrom
skovhus:fix/vite8-css-duplication
Open

[unplugin] Fix Vite 8 CSS duplication#1547
skovhus wants to merge 2 commits intofacebook:mainfrom
skovhus:fix/vite8-css-duplication

Conversation

@skovhus
Copy link
Contributor

@skovhus skovhus commented Mar 24, 2026

What changed / motivation ?

In Vite 8 (Rolldown), CSS assets are present during generateBundle, causing StyleX CSS to be injected twice — once in generateBundle and again in writeBundle.

This PR tracks whether generateBundle succeeded and skip writeBundle when it did, preserving the fallback for SSR/Workers.

Linked PR/Issues

n/a

Additional Context

n/a

Pre-flight checklist

skovhus and others added 2 commits March 24, 2026 11:50
In Vite 8 (Rolldown), CSS assets are present during generateBundle,
causing StyleX CSS to be injected twice — once in generateBundle and
again in writeBundle. Track whether generateBundle succeeded and skip
writeBundle when it did, preserving the fallback for SSR/Workers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that writeBundle is skipped when generateBundle already injected
CSS, and that the writeBundle fallback still works when no CSS asset
exists during generateBundle (SSR/Workers).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 24, 2026

@skovhus is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant