fix(pack): bundle @tsdown/exe and @tsdown/css into core#1919
Open
fengmk2 wants to merge 8 commits into
Open
Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
✅ Staging deployment successful! Preview: https://viteplus-staging.void.app/ |
fengmk2
commented
Jun 23, 2026
vite-plus
@voidzero-dev/vite-plus-core
@voidzero-dev/vite-plus-prompts
@voidzero-dev/vite-plus-cli-darwin-arm64
@voidzero-dev/vite-plus-cli-darwin-x64
@voidzero-dev/vite-plus-cli-linux-arm64-gnu
@voidzero-dev/vite-plus-cli-linux-arm64-musl
@voidzero-dev/vite-plus-cli-linux-x64-gnu
@voidzero-dev/vite-plus-cli-linux-x64-musl
@voidzero-dev/vite-plus-cli-win32-arm64-msvc
@voidzero-dev/vite-plus-cli-win32-x64-msvc
@voidzero-dev/vite-plus-darwin-arm64
@voidzero-dev/vite-plus-darwin-x64
@voidzero-dev/vite-plus-linux-arm64-gnu
@voidzero-dev/vite-plus-linux-arm64-musl
@voidzero-dev/vite-plus-linux-x64-gnu
@voidzero-dev/vite-plus-linux-x64-musl
@voidzero-dev/vite-plus-win32-arm64-msvc
@voidzero-dev/vite-plus-win32-x64-msvc
commit: |
@tsdown/exe and @tsdown/css hard-peer-depend on tsdown and import tsdown/internal, but Vite+ bundles tsdown internally with no resolvable top-level tsdown package, so installing them failed with "Failed to import module @tsdown/exe". Bundle both into core (tsdown-exe.js, tsdown-css.js) so they resolve tsdown/internal at build time and work without any extra install. lightningcss (native) stays external as an optional peer, loaded lazily with an actionable error when it is missing. Closes #1586
Add the command-pack-css-missing-lightningcss snap test: a resolve hook makes lightningcss unresolvable (the dev/CI monorepo always has it), so vp pack surfaces the actionable install hint. Locks in that the error tells users how to fix it.
…sdown They are bundled into core and exact-peer-depend on the same tsdown version, so the catalog entries must track tsdown on every upgrade run.
…al peer lightningcss is already a core dependency (Vite's lightningcss transformer uses it), so the bundled @tsdown/css can use it directly and CSS bundling works with no extra install. Revert the optional-peer + loader churn: keep lightningcss in dependencies (via catalog) and drop the __vpImportLightningcss helper and the missing-lightningcss snap test.
…xtensions in Renovate lightningcss is a core dependency consumed by the bundled @tsdown/css, so upgrade-deps now mirrors @tsdown/css's lightningcss range into the catalog when bumping tsdown. Also ignore @tsdown/css, @tsdown/exe and lightningcss in Renovate so they stay in lockstep with tsdown instead of drifting.
44bdb72 to
e107015
Compare
- wireBundledTsdownExtensions: scan every emitted chunk (not just build-*.js) and assert the bundled ./tsdown-css.js is referenced, so a rolldown chunking change can't silently ship an unrewritten import. - upgrade-deps: match any lightningcss range value so a non-caret range from @tsdown/css can't poison the next run's pattern. - rfc: lightningcss is a core dependency, not an optional peer.
getLatestNpmVersion and getNpmDependencyRange duplicated the same registry fetch + ok-check + json block; extract fetchNpmLatest so the registry URL and error wording live in one place.
Node 26 is the version the exe targets default to and clears the 25.7 SEA floor; `vp env use 25` could resolve below it.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Member
Author
|
cc @sxzz |
cpojer
approved these changes
Jun 23, 2026
sxzz
approved these changes
Jun 23, 2026
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.
Problem
@tsdown/exeand@tsdown/csshard-peer-depend ontsdownand importtsdown/internal, but Vite+ bundles tsdown internally with no resolvable top-leveltsdownpackage. Installing them at the project level fails withFailed to import module "@tsdown/exe"(and the equivalent for CSS bundling).Fix
Bundle both extensions into core (
tsdown-exe.js,tsdown-css.js) sotsdown/internalresolves at build time andvp pack --exe/ CSS bundling work with no extra install.lightningcss(native, cannot be bundled) becomes an optional peer, loaded lazily with an actionable error when it is missing.Tests
command-pack-css: CSS transforms run through the bundled@tsdown/css+ lightningcss.command-pack-tsdown-extensions: the bundled exe/css chunks load without a top-leveltsdown.Closes #1586