fix(vapor): ship real per-component CSS via tsdown - #24
Merged
Conversation
vael-ui/vapor built with zero CSS at all — the generator stripped every component's CSS import under the assumption a consumer already had styles loaded some other way. It now copies each component's CSS alongside its generated source and keeps the import, same as the vdom build. vapor-ui's build also moves from Vite library mode to tsdown, matching packages/ui's proven config, for real per-component CSS code-splitting. tsdown's own dts generation is skipped (Vapor SFCs type as plain function components, which fails downstream template type-checking) in favor of the existing emit-vapor-types.mjs, which reuses the vdom build's DefineComponent types instead.
Merged
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.
Summary
vael-ui/vapor(and thevaporexport condition added in 0.2.1) shipped with zero CSS — the generator stripped every component's CSS import under the assumption a consumer already had styles loaded some other way. It now copies each component's CSS alongside its generated source and keeps the import, same as the vdom build.vapor-ui's build moves from Vite library mode totsdown, matchingpackages/ui's already-proven config, giving vapor the same real per-component CSS code-splitting.abstract new (...args) => anyconstraint). Restoredemit-vapor-types.mjs, which re-exports the vdom build's ownDefineComponenttypes for the same components instead (type-only, erased at runtime, so the mismatch is harmless).Verification
vite buildimporting onlyButtonviaresolve.conditions: ['vapor']: 58.7KB JS + 9.8KB CSS, containing onlyButton— no other of the 69 components leaked.vaporcondition: correct DOM, correct computed styles, zero console errors.pnpm build,pnpm typecheck:only, and both test suites (691 + 16 tests) pass clean from a from-scratch rebuild.Test plan
pnpm build(root) — cleanpnpm typecheck:only— cleanpnpm --filter vael-ui test— 691/691 passedpnpm --filter vapor-ui test— 16/16 passedvite build+ Playwright render check against thevaporcondition