Skip to content

Commit

Permalink
Only set package data map under watch mode (#46211) (#46235)
Browse files Browse the repository at this point in the history
Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
  • Loading branch information
DanielRosenwasser and weswigham authored Oct 6, 2021
1 parent 34988fd commit f54ef83
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compiler/tsbuildPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 && 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++;
Expand Down

0 comments on commit f54ef83

Please sign in to comment.