0

I'm trying to include an NPM package (this one), that has a dependency that needs aliasing to get the browser version (as described here) in my ember-cli build. In the official documentation, it's not really clear how this can be done.

Ideally, this would be something like this:

app.import('joi-browser', { alias: 'joi' });
app.import('edzif-validation');

But that does not work. Does anyone have a clue on how to coax the ember-cli/broccoli setup to do this?

Community
  • 1
  • 1
mikl
  • 23,749
  • 20
  • 68
  • 89
  • Side Note: app.import is only for bower_components and vendor folder. and also app.import should include path smething like this app.import('bower_components/.js') – Ember Freak Dec 27 '16 at 19:44
  • @kumkanillam as stated, the example doesn't work, but if you have some information on how to include npm packages, I'm all ears. – mikl Dec 27 '16 at 19:47
  • 1
    this [answer](http://stackoverflow.com/a/29544299/5771666) will help. Basically install` ember-browserify` addon and npm install the required module and import using from `npm:modulename` – Ember Freak Dec 27 '16 at 19:50
  • 3
    Possible duplicate of [How to use third party npm packages with ember cli app](http://stackoverflow.com/questions/26544578/how-to-use-third-party-npm-packages-with-ember-cli-app) – locks Dec 29 '16 at 12:23
  • @locks as far as I can see, the other one doesn't cover the aliasing part. – mikl Dec 29 '16 at 12:25

0 Answers0