mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Try the ParsedCommandLine from cache instead of re-reading contents of tsconfig file
This commit is contained in:
parent
59060a1b90
commit
50bcfb6328
@ -356,10 +356,19 @@ namespace ts {
|
||||
}
|
||||
|
||||
function createConfigFileCache(host: CompilerHost) {
|
||||
const cache = createFileMap<ParsedCommandLine>();
|
||||
const cache = createFileMap<ParsedCommandLine | "error">();
|
||||
const configParseHost = parseConfigHostFromCompilerHost(host);
|
||||
|
||||
function isParsedCommandLine(value: ParsedCommandLine | "error"): value is ParsedCommandLine {
|
||||
return !(value as "error").length;
|
||||
}
|
||||
|
||||
function parseConfigFile(configFilePath: ResolvedConfigFileName) {
|
||||
const value = cache.getValueOrUndefined(configFilePath);
|
||||
if (value) {
|
||||
return isParsedCommandLine(value) ? value : undefined;
|
||||
}
|
||||
|
||||
const sourceFile = host.getSourceFile(configFilePath, ScriptTarget.JSON) as JsonSourceFile;
|
||||
if (sourceFile === undefined) {
|
||||
return undefined;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user