Limit package.json realpath lookup to only successful resolutions

This commit is contained in:
Wesley Wigham
2021-10-04 12:40:27 -07:00
parent 5423501c37
commit 228679871a
+1 -1
View File
@@ -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) {