diff --git a/src/summary.ts b/src/summary.ts index 2aac383b1..ffbff10fb 100644 --- a/src/summary.ts +++ b/src/summary.ts @@ -81,7 +81,12 @@ export class FileSummary { } get weakRequires(): Symbol[] { - return [...this.weakRequireSet.values()]; + const weakRequires = []; + for (const [k, v] of this.weakRequireSet.entries()) { + if (this.strongRequireSet.has(k)) continue; + weakRequires.push(v); + } + return weakRequires; } addDynamicRequire(dynamicRequire: Symbol) {