-
-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
Description
Reproduction link or steps
https://stackblitz.com/github/fengmk2/tsdown-vs-tsc?file=README.md
Reproduce Build Output
npm run buildWhat is expected?
The tsdown + unbundle build output should import './types.js'
// dist-unbundle/index.d.ts
import './types.js';
//#region src/index.d.ts
declare function main(): void;
//#endregion
export { main };What is actually happening?
Missing the import './types.js'
// dist-unbundle/index.d.ts
//#region src/index.d.ts
declare function main(): void;
//#endregion
export { main };Any additional comments?
When building a project using tsdown + unbundle, the output files lack the type declaration file import './types.ts', whereas building with tsc will generate the type declaration files.
tsdown + bundle build output:
- Input:
src/index.tsand dependencies - Output:
dist-bundle/index.jsanddist-bundle/index.d.ts
tsdown + unbundle build output:
- Input:
src/index.tsand dependencies - Output:
dist-unbundle/index.jsanddist-unbundle/index.d.ts
tsc build output:
- Input:
src/index.tsand dependencies - Output:
dist-tsc/index.jsanddist-tsc/index.d.ts
The tsdown + unbundle build output is missing the types import './types.ts'.
// dist-unbundle/index.d.ts
//#region src/index.d.ts
declare function main(): void;
//#endregion
export { main };// dist-tsc/index.d.ts
import './types.ts';
export declare function main(): void;// dist-bundle/index.d.ts
import "./types-_8Ni1WEK.js";
//#region src/index.d.ts
declare function main(): void;
//#endregion
export { main };