fix: disable filename hashing to resolve type definition errors - #35
Merged
requesty-JohnCosta27 merged 1 commit intoJan 30, 2026
Conversation
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 6a4f8ce..a60ab6e
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (1)
• tsdown.config.ts
Contributor
Author
|
Friendly ping @requesty-JohnCosta27 |
Contributor
Sorry this must have skipped my inbox. Lovely thank you for the contribution! |
requesty-JohnCosta27
approved these changes
Jan 30, 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.
fix: disable filename hashing in tsdown to fix type resolution
Description
The Problem
Currently, the build configuration uses the default behavior of
tsdown, which generates hashed filenames for chunks (e.g.,dist/index-F6sdE3i3.d.ts).The Consequence
Standard TypeScript environments (specifically Node.js without bundlers) fail to resolve the type definitions because
package.jsonpoints to a static entry point, but the actual files on disk have dynamic hashes. This leads to the error:The Fix
I explicitly added
hash: falsetotsdown.config.ts. This ensures the output files have stable filenames (e.g.,index.d.ts), matching what the package entry points expect.Verification
pnpm build).dist/now contains clean.d.tsfiles without hashes.pnpm linkand confirmed the TypeScript error is resolved.Related Issue
Closes #34
High-level PR Summary
This PR fixes TypeScript type definition resolution errors by disabling filename hashing in the
tsdownbuild configuration. Previously, the build generated files with dynamic hashes (likeindex-F6sdE3i3.d.ts) which prevented Node.js environments from resolving type definitions that referenced static filenames. By settinghash: falsein two build configurations, the output files now have stable, predictable names that match the package entry points.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
tsdown.config.ts