From f17c7fd47b20135330f4734b91b8126c325ccf59 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 4 Oct 2021 13:16:06 -0700 Subject: [PATCH] Only set package data map under watch mode --- 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 e01810b5d714e..ae3fd3be20d2a 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -872,12 +872,12 @@ namespace ts { getConfigFileParsingDiagnostics(config), config.projectReferences ); - 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) - )); - 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++;