Skip to content

Commit

Permalink
Do not assume imports are ESM (#8555)
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Oct 18, 2022
1 parent a171677 commit c1942c9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/transformers/js/src/JSTransformer.js
Expand Up @@ -856,8 +856,18 @@ export default (new Transformer({
}
}

for (let {source, local, imported, loc} of symbol_result.imports) {
let dep = deps.get(source + 'esm');
for (let {
source,
local,
imported,
kind,
loc,
} of symbol_result.imports) {
let specifierType = '';
if (kind === 'Import' || kind === 'Export') {
specifierType = 'esm';
}
let dep = deps.get(source + specifierType);
if (!dep) continue;
dep.symbols.ensure();
dep.symbols.set(imported, local, convertLoc(loc));
Expand Down

0 comments on commit c1942c9

Please sign in to comment.