Skip to content

Commit 9eeb6a0

Browse files
authored
Do not warn unnecessarily for namespace conflicts (#4363)
* Do not warn for hidden namespace conflicts * Merge conflict detection into export resolution
1 parent 3ca594e commit 9eeb6a0

15 files changed

Lines changed: 131 additions & 128 deletions

File tree

src/ExternalModule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ export default class ExternalModule {
6464
};
6565
}
6666

67-
getVariableForExportName(name: string): ExternalVariable {
67+
getVariableForExportName(name: string): [variable: ExternalVariable] {
6868
let declaration = this.declarations[name];
69-
if (declaration) return declaration;
69+
if (declaration) return [declaration];
7070

7171
this.declarations[name] = declaration = new ExternalVariable(this, name);
7272
this.exportedVariables.set(declaration, name);
73-
return declaration;
73+
return [declaration];
7474
}
7575

7676
setRenderPath(options: NormalizedOutputOptions, inputBase: string): string {

src/Graph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export default class Graph {
243243
for (const importDescription of Object.values(module.importDescriptions)) {
244244
if (
245245
importDescription.name !== '*' &&
246-
!importDescription.module.getVariableForExportName(importDescription.name)
246+
!importDescription.module.getVariableForExportName(importDescription.name)[0]
247247
) {
248248
module.warn(
249249
{

0 commit comments

Comments
 (0)