diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig index fd5ae20b20..3b45d5f84b 100644 --- a/src/bundler/bundle_v2.zig +++ b/src/bundler/bundle_v2.zig @@ -9890,19 +9890,17 @@ const LinkerContext = struct { } const records = this.import_records[source_index].slice(); + const kind = this.entry_point_kinds[source_index]; for (this.export_star_records[source_index]) |id| { const record = records[id]; - if (record.source_index.isValid()) { - // This file has dynamic exports if the exported imports are from a file - // that either has dynamic exports directly or transitively by itself - // having an export star from a file with dynamic exports. - const kind = this.entry_point_kinds[record.source_index.get()]; - if ((record.source_index.isInvalid() and (!kind.isEntryPoint() or !this.output_format.keepES6ImportExportSyntax())) or - (record.source_index.isValid() and record.source_index.get() != source_index and this.hasDynamicExportsDueToExportStar(record.source_index.get()))) - { - this.exports_kind[source_index] = .esm_with_dynamic_fallback; - return true; - } + // This file has dynamic exports if the exported imports are from a file + // that either has dynamic exports directly or transitively by itself + // having an export star from a file with dynamic exports. + if ((record.source_index.isInvalid() and (!kind.isEntryPoint() or !this.output_format.keepES6ImportExportSyntax())) or + (record.source_index.isValid() and record.source_index.get() != source_index and this.hasDynamicExportsDueToExportStar(record.source_index.get()))) + { + this.exports_kind[source_index] = .esm_with_dynamic_fallback; + return true; } }