mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Set the files found during node_modules search correctly when reusing existing program structure
This marks files reused correctly as from external library resulting in not using them for files to be emitted and computed for output structure Fixes #19327
This commit is contained in:
@@ -1049,6 +1049,10 @@ namespace ts {
|
||||
// update fileName -> file mapping
|
||||
for (let i = 0; i < newSourceFiles.length; i++) {
|
||||
filesByName.set(filePaths[i], newSourceFiles[i]);
|
||||
// Set the file as found during node modules search if it was found that way in old progra,
|
||||
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
|
||||
sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
|
||||
}
|
||||
}
|
||||
|
||||
files = newSourceFiles;
|
||||
|
||||
@@ -1927,6 +1927,7 @@ declare module "fs" {
|
||||
expectedFiles[1].isExpectedToEmit = false;
|
||||
host.reloadFS(programFiles.concat(configFile));
|
||||
host.runQueuedTimeoutCallbacks();
|
||||
checkProgramActualFiles(watch(), programFiles.map(f => f.path));
|
||||
checkOutputErrors(host, emptyArray);
|
||||
verifyExpectedFiles(expectedFiles);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user