Repository navigation
Conversation
Mirror the Rollup plugin's `extract` option in the Vite plugin:
- `extract: false`: emit per-file CSS assets and rewrite side-effect
imports to the emitted files
- `extract: { name, sourcemap }`: combine all CSS into a single
plugin-emitted asset and strip side-effect CSS imports from JS output
- `undefined` (default): unchanged, Vite's native CSS pipeline
🦋 Changeset detectedLatest commit: eaf5675 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
Closing this. After further end-to-end testing, the documented approach — using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an opt-in
extractoption to@vanilla-extract/vite-plugin, bringing it in line with the Rollup plugin:extract: falseemits each.css.tsfile as its own CSS asset (e.g.assets/button.css.ts.vanilla.css) and rewrites side-effect imports to point at the emitted files, deduped across chunksextract: { name, sourcemap }combines all generated CSS into a single plugin-emitted asset (default namebundle.css) and strips side-effect CSS imports from the JS outputImplementation notes:
packages/rollup-plugin/src/lib.tsinto a self-containedpackages/vite-plugin/src/lib.ts, so the Vite plugin doesn't need to depend on the Rollup plugin.vite build— no effect in dev, and no effect whenunstable_mode: 'transform'is set.Testing: added
tests/vite-plugin/extract.test.tscovering per-file emission (single and multiple entries, including dedupe), bundle mode with import stripping, minified output and sourcemaps. Alltests/vite-plugintests pass,pnpm buildand lint are clean. Includes a changeset.Site docs are intentionally untouched — happy to add an
extractsection to the Vite integration docs if useful.