Skip to content

Commit 0d42d71

Browse files
authored
Merge pull request #1937 from embroider-build/v2-addon-registration
only register v2 addons with parent addons
2 parents 93b39c4 + 100e322 commit 0d42d71

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/addon-shim/src/index.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,12 @@ export function addonV1Shim(directory: string, options: ShimOptions = {}) {
163163
}
164164
autoImport.instance.registerV2Addon(name, root);
165165
} else {
166-
// if we're being used by a v2 addon, it also has this shim and will
167-
// forward our registration onward to ember-auto-import
168-
(this.parent as EAI2Instance).registerV2Addon(name, root);
166+
// This should only be done if we're being consumed by an addon
167+
if (this.parent.pkg['ember-addon'].type === 'addon') {
168+
// if we're being used by a v2 addon, it also has this shim and will
169+
// forward our registration onward to ember-auto-import
170+
(this.parent as EAI2Instance).registerV2Addon(name, root);
171+
}
169172
}
170173
},
171174
};

0 commit comments

Comments
 (0)