From 494876c5862a46668a7f4a3e8cbb4f967b39c79a Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 5 Oct 2021 11:13:26 -0700 Subject: [PATCH] Only set package data map under watch mode (#46211) --- src/compiler/tsbuildPublic.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 5284be22787b2..a6f71ec4d4b18 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -871,12 +871,12 @@ namespace ts { getConfigFileParsingDiagnostics(config), config.projectReferences ); - state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map( - state.moduleResolutionCache.getPackageJsonInfoCache().entries(), - ([path, data]) => ([state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data] as const) - )); - if (state.watch) { + state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map( + state.moduleResolutionCache.getPackageJsonInfoCache().entries(), + ([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const) + )); + state.builderPrograms.set(projectPath, program); } step++;