Skip to content

vanilla-extract: Ensure Vanilla Extract styles are bundled into isolated modules#244

Merged
askoufis merged 1 commit intomasterfrom
fix-ve-package
Nov 14, 2025
Merged

vanilla-extract: Ensure Vanilla Extract styles are bundled into isolated modules#244
askoufis merged 1 commit intomasterfrom
fix-ve-package

Conversation

@askoufis
Copy link
Copy Markdown
Contributor

@askoufis askoufis commented Nov 14, 2025

The one thing we forgot to consider when moving to tsdown in #239 was handling Vanilla Extract styles. Since v2.0.2, Vanilla Extract code in @capsizecss/vanilla-extract has been bundled alongside its API code in a single index.mjs/cjs file. This results in a Styles were unable to be assigned to a file error when importing the package because Vanilla Extract usage is no longer isolated to a .css.mjs/cjs file (as it was in v2.0.1).

Crackle handled this with a complicated manual chunking configuration that would "pre-compile" Vanilla Extract modules and keep them isolated from non Vanilla Extract code. The pre-compilation is an optimization of dubious utility, and in the case of this tiny library a correct bundle output can be recreated with unbundle: true (effectively the same as preserveModules: true).

@askoufis askoufis requested a review from a team as a code owner November 14, 2025 02:55
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 14, 2025

🦋 Changeset detected

Latest commit: 9e1a683

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@capsizecss/vanilla-extract Patch

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file were meant to be added in #242. They don't need to be published however since they made it into the published package anyway.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah interesting. Works in the pipeline but out of sync with the source. Possibly something we try to catch via linting.

Copy link
Copy Markdown
Contributor

@michaeltaranto michaeltaranto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👏

@askoufis askoufis changed the title Ensure Vanilla Extract styles are bundled into isolated modules vanilla-extract: Ensure Vanilla Extract styles are bundled into isolated modules Nov 14, 2025
@askoufis askoufis merged commit 630c4dd into master Nov 14, 2025
6 checks passed
@askoufis askoufis deleted the fix-ve-package branch November 14, 2025 03:09
@seek-oss-ci seek-oss-ci mentioned this pull request Nov 14, 2025
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.

2 participants