Skip to content

Commit 9f19007

Browse files
weswighamtypescript-bot
authored andcommitted
Cherry-pick PR microsoft#46209 into release-4.4
Component commits: 2286798 Limit package.json realpath lookup to only successful resolutions
1 parent bbb31bb commit 9f19007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/tsbuildPublic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ namespace ts {
873873
);
874874
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
875875
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
876-
([path, data]) => ([state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data] as const)
876+
([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const)
877877
));
878878

879879
if (state.watch) {

0 commit comments

Comments
 (0)