Only set package data map under watch mode (#46211)

This commit is contained in:
Wesley Wigham 2021-10-05 11:13:26 -07:00 committed by GitHub
parent a0cf126513
commit 47cd4d3ecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 && 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++;