diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 51288821cab6a..7e5bba35e44d3 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -804,7 +804,7 @@ namespace ts { } if ((oldSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport) !== (newSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport)) { // dynamicImport has changed - oldProgram.structureIsReused = StructureIsReused.Not; + oldProgram.structureIsReused = StructureIsReused.SafeModules; } if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {