Skip to content

Commit

Permalink
Merge conflict detection into export resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Jan 24, 2022
1 parent dd7b7de commit 41086b3
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 140 deletions.
6 changes: 3 additions & 3 deletions src/ExternalModule.ts
Expand Up @@ -64,13 +64,13 @@ export default class ExternalModule {
};
}

getVariableForExportName(name: string): ExternalVariable {
getVariableForExportName(name: string): [variable: ExternalVariable] {
let declaration = this.declarations[name];
if (declaration) return declaration;
if (declaration) return [declaration];

this.declarations[name] = declaration = new ExternalVariable(this, name);
this.exportedVariables.set(declaration, name);
return declaration;
return [declaration];
}

setRenderPath(options: NormalizedOutputOptions, inputBase: string): string {
Expand Down
2 changes: 1 addition & 1 deletion src/Graph.ts
Expand Up @@ -243,7 +243,7 @@ export default class Graph {
for (const importDescription of Object.values(module.importDescriptions)) {
if (
importDescription.name !== '*' &&
!importDescription.module.getVariableForExportName(importDescription.name)
!importDescription.module.getVariableForExportName(importDescription.name)[0]
) {
module.warn(
{
Expand Down

0 comments on commit 41086b3

Please sign in to comment.