Skip to content

Commit f9bc4db

Browse files
authored
Only set package data map under watch mode (#46211)
1 parent bbb31bb commit f9bc4db

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/compiler/tsbuildPublic.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,11 @@ 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 ? toPath(state, state.host.realpath(path)) : path, data] as const)
877-
));
878-
879874
if (state.watch) {
880-
state.builderPrograms.set(projectPath, program);
875+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
876+
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
877+
([path, data]) => ([state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data] as const)
878+
));
881879
}
882880
step++;
883881
}

0 commit comments

Comments
 (0)