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