Skip to content

Commit

Permalink
Merge pull request #2261 from embroider-build/codemod-deduplication-bug
Browse files Browse the repository at this point in the history
Fix bug in import deduplication in template-tag-codemod
  • Loading branch information
ef4 authored Feb 11, 2025
2 parents 4d726b6 + f2c28ea commit 5d79e14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/template-tag-codemod/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,10 @@ function renderScopeImports(scope: MetaResult['scope']) {
sections.push(def[0]);
}

let named = entries.filter(e => e[1] !== 'default');
// it's possible to have more than one local name for the default export,
// so this filter must only ignore the entry that we handled above, not
// any others that happen to use `default` as their imported name.
let named = entries.filter(e => e !== def);
if (named.length > 0) {
sections.push(
'{' +
Expand Down

0 comments on commit 5d79e14

Please sign in to comment.