Skip to content

Commit

Permalink
only register v2 addons with parent addons
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed May 22, 2024
1 parent 62a3d09 commit 100e322
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 100e322

Please sign in to comment.