mardi 1 mars 2016

Include bower component in Ember Addon

How do you need to work in an Ember addon, to include bower packages while installing the addon.

1) I installed the bower package I want to include in my addon with bower instal packagename --save

2) then in my addon, in the root, edited index.js, to look like this:

/* jshint node: true */
'use strict';

module.exports = {
  name: 'my-ember-component',
  included: function(app) {
    this._super.included(app);

    if(app.import){
      app.import(app.bowerDirectory + '/path-to-package/package.js');
    }
  }
};

However, when I try to start my application where the addon is installed, I get a ENOENT: no such file or directory, stat '/my-ember-application/tmp/source_map_concat-input_base_path-http://ift.tt/1TO2tK1

I want to avoid having to manually add the bower dependency to every application I install my addon in.

Note: I am using npm link to debug my addon, perhaps this could be a source of the problem?




Aucun commentaire:

Enregistrer un commentaire