-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experimentalDts
generates broken type declarations.
#1050
Comments
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 |
By the way, have you tried to remove the |
Hi thanks for responding so promptly. |
@ocavue This is the smallest I could get it to in a short amount of time. To reproduce:
|
Thanks! The generated |
Awesome, thank you. |
Facing the same issue with tsup@8.0.1 and @microsoft/api-extractor@7.39.1 |
Facing the same issue tsup/8.1.0 darwin-arm64 node-v20.11.0 The bug appears to be on this line: Line 125 in 796fc50
|
We were able to workaround this by using // tsup.config.ts
import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts"],
format: ["esm"],
onSuccess: "yarn tsc -p tsconfig.tsup.json && echo 'Rebuilt'",
}); // tsconfig.tsup.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"include": ["src"],
"compilerOptions": {
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "dist",
"rootDir": "src"
}
} That also fixes #977 and a few other issues |
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
The text was updated successfully, but these errors were encountered: