Skip to content

Commit f54ef83

Browse files
Only set package data map under watch mode (#46211) (#46235)
Co-authored-by: Wesley Wigham <[email protected]>
1 parent 34988fd commit f54ef83

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/compiler/tsbuildPublic.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,12 @@ namespace ts {
871871
getConfigFileParsingDiagnostics(config),
872872
config.projectReferences
873873
);
874-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
875-
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
876-
([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const)
877-
));
878-
879874
if (state.watch) {
875+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
876+
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
877+
([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const)
878+
));
879+
880880
state.builderPrograms.set(projectPath, program);
881881
}
882882
step++;

0 commit comments

Comments
 (0)