Skip to content

Commit

Permalink
Only set package data map under watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Oct 4, 2021
1 parent 5423501 commit 1f624f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compiler/tsbuildPublic.ts
Expand Up @@ -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 ? 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 ? toPath(state, state.host.realpath(path)) : path, data] as const)
));

state.builderPrograms.set(projectPath, program);
}
step++;
Expand Down

0 comments on commit 1f624f3

Please sign in to comment.