mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 13:59:04 -05:00
Ensure that we are checking if correct file with resolved path is present in the new program when removing the existing packageJson watching (#57988)
This commit is contained in:
@@ -750,7 +750,8 @@ export function createResolutionCache(resolutionHost: ResolutionCacheHost, rootD
|
||||
else impliedFormatPackageJsons.delete(newFile.resolvedPath);
|
||||
});
|
||||
impliedFormatPackageJsons.forEach((existing, path) => {
|
||||
if (!newProgram?.getSourceFileByPath(path)) {
|
||||
const newFile = newProgram?.getSourceFileByPath(path);
|
||||
if (!newFile || newFile.resolvedPath !== path) {
|
||||
existing.forEach(location => fileWatchesOfAffectingLocations.get(location)!.files--);
|
||||
impliedFormatPackageJsons.delete(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user