Skip to content

Commit

Permalink
Cherry-pick PR #46209 into release-4.4 (#46230)
Browse files Browse the repository at this point in the history
Component commits:
2286798 Limit package.json realpath lookup to only successful resolutions

Co-authored-by: Wesley Wigham <t-weswig@microsoft.com>
  • Loading branch information
typescript-bot and weswigham committed Oct 6, 2021
1 parent bbb31bb commit 34988fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/tsbuildPublic.ts
Expand Up @@ -873,7 +873,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 34988fd

Please sign in to comment.