Skip to content

Commit 1ca47fd

Browse files
authored
fix: pass in projectReferences to avoid missing some error reports (#288)
1 parent e67e8c6 commit 1ca47fd

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.changeset/proud-sheep-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rslib/core': patch
3+
---
4+
5+
release

packages/plugin-dts/src/tsc.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ export async function emitDts(
2727
const start = Date.now();
2828
const { configPath, declarationDir, name, dtsExtension, banner, footer } =
2929
options;
30-
const { options: rawCompilerOptions, fileNames } = loadTsconfig(configPath);
30+
const {
31+
options: rawCompilerOptions,
32+
fileNames,
33+
projectReferences,
34+
} = loadTsconfig(configPath);
3135

3236
const compilerOptions = {
3337
...rawCompilerOptions,
@@ -40,11 +44,12 @@ export async function emitDts(
4044
if (!isWatch) {
4145
const host: ts.CompilerHost = ts.createCompilerHost(compilerOptions);
4246

43-
const program: ts.Program = ts.createProgram(
44-
fileNames,
45-
compilerOptions,
47+
const program: ts.Program = ts.createProgram({
48+
rootNames: fileNames,
49+
options: compilerOptions,
50+
projectReferences,
4651
host,
47-
);
52+
});
4853

4954
const emitResult = program.emit();
5055

0 commit comments

Comments
 (0)