-
Notifications
You must be signed in to change notification settings - Fork 650
Closed
Description
Summary
In my project, I have libraries that generate types using vite-plugin-dts
which uses underneath api-extractor
.
When I migrated the tsconfig.json
from moduleResolution: node
to moduleResolution: bundler
I realised that the output .d.ts
was not identical.
Repro steps
The following repository is configured to use the api-extractor
on the same code, but with 3 different moduleResolution
: node
, node16
and bundler
.`
git clone [email protected]:Lukinoh/repro-api-extractor-bug
(Stackblitz)cd repro-api-extractor-bug
npm install
npm run build
- Look at the
dist
folders, it contains for eachmoduleResolution
:- The result of the
tsc
build - The extracted
.d.ts
- The diagnostics
- The result of the
The extracted .d.ts
of node16
and bundler
are different from node
.
I would have expected to have the content.
Expected result:
declare class ClassExample {
field1: number;
field2: string;
}
export declare const functions: ClassExample[];
export { }
Actual result:
import { ClassExample } from './hop/f1.ts';
export declare const functions: ClassExample[];
export { }
Standard questions
Please answer these questions to help us investigate your issue more quickly:
Question | Answer |
---|---|
@microsoft/api-extractor version? |
7.49.2 |
Operating system? | Linux (WSL2) |
API Extractor scenario? | rollups (.d.ts) |
Would you consider contributing a PR? | No |
TypeScript compiler version? | 5.7.2 |
Node.js version (node -v )? |
22.14.0 |
andreww2012 and dcsaszar
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Closed