When installing unrelated package inside scoped packages dont invalidate resolutions from everything in the scoped package (#53873)

This commit is contained in:
Sheetal Nandi
2023-04-17 12:37:32 -07:00
committed by GitHub
parent 020ce0c08c
commit 53d378720a
4 changed files with 548 additions and 6 deletions

View File

@@ -1152,7 +1152,7 @@ export function createResolutionCache(resolutionHost: ResolutionCacheHost, rootD
// If the invalidated file is from a node_modules package, invalidate everything else
// in the package since we might not get notifications for other files in the package.
// This hardens our logic against unreliable file watchers.
const packagePath = parseNodeModuleFromPath(fileOrDirectoryPath);
const packagePath = parseNodeModuleFromPath(fileOrDirectoryPath, /*isFolder*/ true);
if (packagePath) (startsWithPathChecks ||= new Set()).add(packagePath as Path);
}
}