Skip to content

Commit 5111f4d

Browse files
committed
Move proj ref logic to the right place
1 parent 7ad9d57 commit 5111f4d

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

src/compiler/program.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -618,25 +618,27 @@ namespace ts {
618618
// A parallel array to projectReferences storing the results of reading in the referenced tsconfig files
619619
const resolvedProjectReferences: (ResolvedProjectReference | undefined)[] | undefined = projectReferences ? [] : undefined;
620620
const projectReferenceRedirects: Map<string> = createMap();
621-
if (projectReferences) {
622-
for (const ref of projectReferences) {
623-
const parsedRef = parseProjectReferenceConfigFile(ref);
624-
resolvedProjectReferences!.push(parsedRef);
625-
if (parsedRef) {
626-
if (parsedRef.commandLine.options.outFile) {
627-
const dtsOutfile = changeExtension(parsedRef.commandLine.options.outFile, ".d.ts");
628-
processSourceFile(dtsOutfile, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined);
629-
}
630-
addProjectReferenceRedirects(parsedRef.commandLine, projectReferenceRedirects);
631-
}
632-
}
633-
}
634-
621+
635622
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
636623
const structuralIsReused = tryReuseStructureFromOldProgram();
637624
if (structuralIsReused !== StructureIsReused.Completely) {
638625
processingDefaultLibFiles = [];
639626
processingOtherFiles = [];
627+
628+
if (projectReferences) {
629+
for (const ref of projectReferences) {
630+
const parsedRef = parseProjectReferenceConfigFile(ref);
631+
resolvedProjectReferences!.push(parsedRef);
632+
if (parsedRef) {
633+
if (parsedRef.commandLine.options.outFile) {
634+
const dtsOutfile = changeExtension(parsedRef.commandLine.options.outFile, ".d.ts");
635+
processSourceFile(dtsOutfile, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined);
636+
}
637+
addProjectReferenceRedirects(parsedRef.commandLine, projectReferenceRedirects);
638+
}
639+
}
640+
}
641+
640642
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false));
641643

642644
// load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders

0 commit comments

Comments
 (0)