Skip to content

Commit

Permalink
Merge pull request #1940 from embroider-build/v2-addon-registration
Browse files Browse the repository at this point in the history
only register v2 addons with parent addons
  • Loading branch information
mansona committed May 22, 2024
2 parents 5422cfd + 100e322 commit 45f521c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/addon-shim/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@ export function addonV1Shim(directory: string, options: ShimOptions = {}) {
}
autoImport.instance.registerV2Addon(name, root);
} else {
// if we're being used by a v2 addon, it also has this shim and will
// forward our registration onward to ember-auto-import
(this.parent as EAI2Instance).registerV2Addon(name, root);
// This should only be done if we're being consumed by an addon
if (this.parent.pkg['ember-addon'].type === 'addon') {
// if we're being used by a v2 addon, it also has this shim and will
// forward our registration onward to ember-auto-import
(this.parent as EAI2Instance).registerV2Addon(name, root);
}
}
},
};
Expand Down

0 comments on commit 45f521c

Please sign in to comment.