Merged
Conversation
tsdown enables globImport by default, which causes rolldown to resolve import.meta.glob calls at library build time. Since /app/ does not exist during the build, all globs resolve to empty objects, breaking island hydration, auto-routing, and manifest loading. Setting globImport: false preserves the expressions so that the consumer's Vite build can process them correctly.
Member
|
This will fix #360 |
yusukebe
reviewed
Feb 24, 2026
| "types": "./dist/client/index.d.ts", | ||
| "import": "./dist/client/index.js" | ||
| }, | ||
| "./utils/*": { |
Member
|
Thank you for your polite PR. Looks good. I'll merge. |
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
tsup is no longer actively maintained and recommends migrating to tsdown. This PR follows that recommendation and replaces tsup with tsdown, which is built on top of rolldown and provides better alignment with the Vite/rolldown ecosystem.
For easier review, I also added a link to the actual build output (generated artifacts), which you can inspect directly on GitHub here: https://github.com/nakanoasaservice/honox/pull/3/files
Changes
tsup.config.tswithtsdown.config.tsprepare,build, andwatchscripts to usetsdownexportsfield inpackage.jsonvia tsdown's built-inexports: trueoption, removing the need to maintain it manuallyutils/*entry fromtypesVersionsCritical fix: preserve
import.meta.globtsdown enables
globImportby default, which causes rolldown to resolveimport.meta.glob()calls at library build time. Since/app/does not exist in this repository, all globs would resolve to empty objects —silently breaking island hydration, auto-routing, and manifest loading for every consumer.Setting
globImport: falsepreserves the expressions as-is so that the consumer's Vite build can process them correctly, matching the behavior of the previous tsup/esbuild output.Notes on output differences
The generated files have minor cosmetic differences compared to tsup (indentation style,
#regioncomments, import ordering), but are functionally equivalent.One observable difference is that the
typemodifier on re-exports in.d.tsfiles is inconsistently applied between tsup and tsdown — in some leaf files (e.g.client/client.d.ts) tsdown omitstypefromexport { type ClientOptions }, while in index files it adds it where tsup did not. This has no practical impact: TypeScript infers type-only status from the original declaration (e.g.type ClientOptions = ...), so consumers withverbatimModuleSyntax: trueare unaffected for any public import path.Discussion: remove
typesVersions?typesVersionsis kept as-is for backwards compatibility with older TypeScript versions that do not support theexportsfield for type resolution. However, since theexportsfield is now the source of truth (and is auto-generated),typesVersionsmust be kept in sync manually. Given that TypeScript 4.7+ (released 2022) supportsexports-based type resolution, it may be worth droppingtypesVersionsentirely in a future change.