-
-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Reproduction link or steps
https://stackblitz.com/edit/github-9x4fstux?file=dist%2Findex.d.ts
This reproduction contains a minimal library that exports several functions.
The functions are created using another library cva and tailwind-merge that is listed as devDependencies
The intent of this is library so that the consumer of the library do not need to worry about
cvaortailwind-mergedependencies versioning that they have in their own projects, as the resulting library is standalone.
When pnpm build is run, the JS output is correct ✅ because the libraries in devDependencies is bundled.
This is aligned with the behavior of the tsdown as documented:
However, the .d.ts output fails to bundle the types for the internal dependencies, despite configured like the documentation:
As the library is intended to be shipped without the cva dependencies, that means the resulting .d.ts is incorrect.
What is expected?
Run dtsroll that is installed in the reproduction.
❯ pnpm dtsroll
dtsroll
📥 Entry points in package.json
→ dist/index.d.ts from types
💠 Bundled output
● dist/index.d.ts 2.8 kB
├─ dist/index.d.ts
└─ cva (node_modules/.pnpm/cva@1.0.0-beta.3_typescri
The resulting .d.ts is now bundled with type definitions from cva or other internal libraries, enabling consumers of the library to use the library without installing the internal dependencies.
What is actually happening?
The dts:resolve settings do not seem to be respected by tsdown
Any additional comments?
Thank you for making this wonderful project!
I wish tsdown can leverage or collaborate with dtsroll to enable the production of even better TypeScript libraries with zero config.