Generate dts by default if the input is TypeScript even if types field does not exist
#636
Replies: 2 comments
-
|
This behavior is currently based on unbuild and will be improved after issue #150 is resolved. |
Beta Was this translation helpful? Give feedback.
-
|
Given the current situation, it’s still recommended to include the Currently, we support detecting both the Therefore, I will open convert this to a discussion to explore possible changes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently tsdown does not generate dts if the
package.jsondoes not containtypesfield does not exist.https://stackblitz.com/edit/github-d2t3ydlj?file=package.json
Instead of determining the behavior from the
typesfield, I think it would be better to decide it based on the input.If the input is typescript, I think you'd want to generate the dts as well.
typesfield is optional and when it's absent, TypeScript will infer the dts file path frommainfield /exportsfield. This is a valid setup and IMHO it's better than explicitly specifying the path because it's more simple.Beta Was this translation helpful? Give feedback.
All reactions