Skip to content

Commit

Permalink
Limit package.json realpath lookup to only successful resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Oct 4, 2021
1 parent 5423501 commit 2286798
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/tsbuildPublic.ts
Expand Up @@ -874,7 +874,7 @@ namespace ts {
);
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)
([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const)
));

if (state.watch) {
Expand Down

0 comments on commit 2286798

Please sign in to comment.