Skip to content

Commit 47cd4d3

Browse files
authored
Only set package data map under watch mode (#46211)
1 parent a0cf126 commit 47cd4d3

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
@@ -872,12 +872,12 @@ namespace ts {
872872
getConfigFileParsingDiagnostics(config),
873873
config.projectReferences
874874
);
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-
880875
if (state.watch) {
876+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
877+
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
878+
([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const)
879+
));
880+
881881
state.builderPrograms.set(projectPath, program);
882882
}
883883
step++;

0 commit comments

Comments
 (0)