Asked By: Anonymous
I am successfully importing a jQuery plugin via Bower to be used in a component in an Ember-cli addon. However, this only works is because I defined a Bower dependency on this plugin in both the addon and the consuming application.
This seems like I’m doing it wrong. Why should the consuming application have to declare a dependency on a resource that should be provided with the addon?
The crux of the matter seems to be the
app context when building. I can omit the Bower dependency in the consuming application if I use the following
import statement in the addon’s
… but this breaks when I build the addon as a stand-alone application. In that case, this path is required:
How this is intended to work?
- Declaring the Bower dependency in two places seems counter-intuitive
- I don’t know how detect the
appcontext in the
index.jsof the addon
Answered By: Anonymous
Checkout ember-cli homepage on default blueprints. It describes how you can import a bower component package upon installing your addon.