Skip to content

Commit

Permalink
Only set package data map under watch mode (#46211)
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Oct 6, 2021
1 parent bbb31bb commit f9bc4db
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/compiler/tsbuildPublic.ts
Expand Up @@ -871,13 +871,11 @@ 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.builderPrograms.set(projectPath, program);
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)
));
}
step++;
}
Expand Down

0 comments on commit f9bc4db

Please sign in to comment.