@rollup/plugin-typescript Incorrect DTS path
- Rollup Plugin Name: @Rollup/plugin-typescript
- Rollup Plugin Version: 8.4.0
- Rollup Version: 2.79.0
- Operating System (or Browser): macos
- Node Version: v16.16.0
- Link to reproduction (⚠️ read below):
When I set the declarationDir value to ./types, but the output path of the type file is still in dist
Expected Behavior
Type files should be generated in types
Actual Behavior
Type files are generated in dist
Additional Information
https://github.com/rollup/plugins/pull/1252
As a temporary workaround, you can pin @rollup/plugin-typescript to v8.3.3
As a temporary workaround, you can pin @rollup/plugin-typescript to v8.3.3
Thank you for your idea. I tried it, but it didn't work. now I plan to use tsc to build type files
Can we reopen this issue? The plugin is still broken.
Can we reopen this issue? The plugin is still broken.
Sorry, yes, I may have misoperated...
I'm having the issue with either 8.5.0 or 9.0.2. 8.3.3 is working as expected.
The workaround mentioned here does not work either: https://github.com/rollup/plugins/tree/master/packages/typescript#declaration-output-with-outputfile
If using . then no declarations are generated at all.
@CroatiaParanoia BTW if you plan to do something like this:
/dist/main.js
/types/main.d.ts
/src/main.ts
Meaning the output types are not within the same base directory as the js output, than this is not possible. This is not a typescript plugin issue but a rollup limitation, see this comment.
#1378 has been merged and should address this issue
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ