Open ChristophP opened 7 months ago
I cannot reproduce "the components/ folder does not exist" issue with the following repo. Could you provide me a minimal reproduction so that I can better debug it?
https://stackblitz.com/github/issueset/tsup-1050
The output files are shown below. The fact that index.js
and index.d.ts
are not in the same folder looks like an issue, but the declaration file itself seems to be all good.
By the way, have you tried to remove the .tsup
temporary directory and run the build again?
Hi thanks for responding so promptly. I'll to create a minimal repro and will post back.
@ocavue This is the smallest I could get it to in a short amount of time. https://github.com/ChristophP/tsup-experimental-dts-bug
To reproduce:
npm ci
npx tsup
dist/_tsup-dts-rollup.d.ts
and notice how it points at paths that do not exist.Thanks! The generated dist/_tsup-dts-rollup.d.ts
in your repo is indeed messed up. I will fix it.
Awesome, thank you.
Facing the same issue with tsup@8.0.1 and @microsoft/api-extractor@7.39.1
Problem
When using
experimentalDts
in a with components in a subfolder the generated output points to files that don't exist.Version info
tsup 8.0.1 @microsoft/api-extractor 7.38.3
Example
Now when looking into the
dist/_tsup-dts-rollup.d.ts
file it contains references to./components/ComponentA
resulting in broken typings.Proposed fix
The generated paths in
dist/_tsup-dts-rollup.d.ts
somehow reference nonexisting files when the entry code is in a subdirectory, so the fix would probably have to check the actual location of the output file and reference that instead.Other feedback
@ocavue I originally tried out the
experimentalDts
option because I am building a number of entries (20+) and the dts build is very slow (~30 seconds). With the new experimentalDts option this time went down to ~7 seconds. Thanks for that great speed improvement. So it would be very nice to use if the generated paths were correct.Upvote & Fund