From 50bcfb63280155dfd5f9ca51e366b7edf7c6b9ff Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Sep 2018 12:59:38 -0700 Subject: [PATCH] Try the ParsedCommandLine from cache instead of re-reading contents of tsconfig file --- src/compiler/tsbuild.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 4ddda98a41f..b5a95039a02 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -356,10 +356,19 @@ namespace ts { } function createConfigFileCache(host: CompilerHost) { - const cache = createFileMap(); + const cache = createFileMap(); 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;