Skip to content

Commit

Permalink
fix: type roots behavior is inconsistent with tsc (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript authored Sep 19, 2023
1 parent e566089 commit 25086fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/builder/bundless/dts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function getTsconfigPath(cwd: string) {

/**
* get parsed tsconfig.json for specific path
* ref: https://github.com/privatenumber/get-tsconfig#how-can-i-use-typescript-to-parse-tsconfigjson
*/
export function getTsconfig(cwd: string) {
// use require() rather than import(), to avoid jest runner to fail
Expand All @@ -32,6 +33,10 @@ export function getTsconfig(cwd: string) {
tsconfigFile.config,
ts.sys,
path.dirname(tsconfigPath),
undefined,
// specify config file path like tsc, to ensure type roots behavior same as tsc
// ref: https://github.com/microsoft/TypeScript/blob/0464e91c8b67579a4ed840e5783575a493c958e0/src/compiler/program.ts#L2325
tsconfigPath,
);
}
}
Expand Down

0 comments on commit 25086fa

Please sign in to comment.