feat(webpack): support tsconfig.app.json when present (#10221)

This commit is contained in:
Igor Randjelovic
2023-03-28 16:17:51 +02:00
committed by GitHub
parent 6059984555
commit ebb827fb8e
4 changed files with 151 additions and 49 deletions

View File

@ -1,3 +1,4 @@
import { existsSync } from 'fs';
import { resolve } from 'path';
export function getProjectRootPath(): string {
@ -30,6 +31,13 @@ export function getProjectFilePath(filePath: string): string {
return resolve(getProjectRootPath(), filePath);
}
export function getProjectTSConfigPath(): string | undefined {
return [
getProjectFilePath('tsconfig.app.json'),
getProjectFilePath('tsconfig.json'),
].find((path) => existsSync(path));
}
// unused helper, but keeping it here as we may need it
// todo: remove if unused for next few releases
// function findFile(fileName, currentDir): string | null {