When using experimentalDts
in a with components in a subfolder the generated output points to files that don't exist.
tsup 8.0.1
@microsoft/api-extractor 7.38.3
// input files
./src
components/
ComponentA/
index.tsx
// tsup config
export default defineConfig({
target: 'esnext',
platform: 'neutral',
format: 'esm',
experimentalDts: true,
entry: [ "./src/components/ComponentA.tsx" ]
});
// output files (Note how the components/ folder does not exist in dist)
./dist
ComponentA/
index.tsx
_tsup-dts-rollup.d.ts
Now when looking into the dist/_tsup-dts-rollup.d.ts
file it contains references to ./components/ComponentA
resulting in broken typings.
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.
@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.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too