plugins icon indicating copy to clipboard operation
plugins copied to clipboard

@rollup/plugin-typescript Incorrect DTS path

Open croatialu opened this issue 3 years ago • 5 comments

  • 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

croatialu avatar Sep 02 '22 18:09 croatialu

https://github.com/rollup/plugins/pull/1252

croatialu avatar Sep 02 '22 18:09 croatialu

As a temporary workaround, you can pin @rollup/plugin-typescript to v8.3.3

danieleds avatar Sep 15 '22 13:09 danieleds

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

croatialu avatar Sep 15 '22 16:09 croatialu

Can we reopen this issue? The plugin is still broken.

danieleds avatar Sep 15 '22 17:09 danieleds

Can we reopen this issue? The plugin is still broken.

Sorry, yes, I may have misoperated...

croatialu avatar Sep 16 '22 01:09 croatialu

I'm having the issue with either 8.5.0 or 9.0.2. 8.3.3 is working as expected.

daiyam avatar Nov 21 '22 07:11 daiyam

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.

susnux avatar Dec 15 '22 10:12 susnux

@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.

susnux avatar Mar 10 '23 20:03 susnux

#1378 has been merged and should address this issue

shellscape avatar Apr 04 '23 14:04 shellscape

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.

stale[bot] avatar Jun 11 '23 01:06 stale[bot]