From 608cf4806a075e5dbd322557adadad8a2879cd0e Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Fri, 6 Oct 2023 11:38:28 -0600 Subject: [PATCH] Fix solution style tsconfigs Resolves #2406 --- CHANGELOG.md | 1 + src/lib/utils/entry-point.ts | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59c3aeca6..36cbb7c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Bug Fixes +- Fixed tsconfig handling for projects using a solution-style tsconfig, #2406. - Fixed broken settings icons caused by icon caching introduced in 0.25.1, #2408. ### Thanks! diff --git a/src/lib/utils/entry-point.ts b/src/lib/utils/entry-point.ts index 79b982a8c..1490eba55 100644 --- a/src/lib/utils/entry-point.ts +++ b/src/lib/utils/entry-point.ts @@ -289,13 +289,20 @@ function getEntryPrograms( logger: Logger, options: Options, ) { - const rootProgram = ts.createProgram({ - rootNames: options.getFileNames().length - ? options.getFileNames() - : inputFiles, - options: options.getCompilerOptions(), - projectReferences: options.getProjectReferences(), - }); + const noTsConfigFound = + options.getFileNames().length === 0 && + options.getProjectReferences().length === 0; + + const rootProgram = noTsConfigFound + ? ts.createProgram({ + rootNames: inputFiles, + options: options.getCompilerOptions(), + }) + : ts.createProgram({ + rootNames: options.getFileNames(), + options: options.getCompilerOptions(), + projectReferences: options.getProjectReferences(), + }); const programs = [rootProgram]; // This might be a solution style tsconfig, in which case we need to add a program for each