Skip to content

Commit 2286798

Browse files
committed
Limit package.json realpath lookup to only successful resolutions
1 parent 5423501 commit 2286798

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
@@ -874,7 +874,7 @@ namespace ts {
874874
);
875875
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
876876
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
877-
([path, data]) => ([state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data] as const)
877+
([path, data]) => ([state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data] as const)
878878
));
879879

880880
if (state.watch) {

0 commit comments

Comments
 (0)