Open Christopher2K opened 1 year ago
@Christopher2K how exactly are you using the --onSuccess
flag to generate them? --onSuccess 'tsc -d'
doesn't generate anything for me.
Edit: to fix the above and keep things consistent, I'm using the following for my npm run build:watch
command: tsup --watch --onSuccess 'tsup --dts-only'
. It's probably still better to use tsc
for both though, so I'm still curious to hear if anyone has gotten that to work.
That's actually a good idea. The only reason I used tsc is because I feel like d.ts generation is slower with tsup.
@Christopher2K what tsc
command did you use in your onSuccess
flag? I think you're right that it is slower (and not guaranteed consistent with the compiler) to use tsup
so I'd like to switch if you have something that works!
Can confirm that I'm hitting this as well when using experimentalDts
, the dts is generated only the first time.
I confirm the issue with both dts
and experimentalDts
using:
How can I run experimentalDts
using the onSuccess
option?
Or any pointers on how to contribute to a fix?
Description
Hi!
I'm using
tsup
in watch mode for a shared library in a monorepo. I can't get the d.ts generation working in watch mode.My config
Output after saving a file
^ Note that this output doesn't mention dts file and when
Workaround
I'm currently using
tsup --onSuccess
script option to run tsc to get the d.ts files. I'd prefer a built-in solution since this requires me to align tsup and tsc config everytime I'm adding a moduleInfo
Thanks!
Upvote & Fund