lundi 22 mai 2017

Import elasticsearch module in Ember.js

I'm trying to import a browser build for the elasticsearch.js client. I'm using npm as my package manager as EmberJS (v2.13.1) is moving away from bower:

npm install elasticsearch-browser 

Few questions:

  1. Can I directly import the module as it is "built for the browser" and probably doesn't use any CommonJS syntax? If yes, what would the import statement look like?
  2. Am I required to use browserify to import any module I install from the npm registry? Why? How do I know which modules are browser-ready?
  3. I could install the module through bower and then do an app.import in the ember-cli-build.js file. Would that work?

As I understand, it finally comes down to using bower vs installing browserify, correct? But I still don't understand why I should have to use a transpiler.




Aucun commentaire:

Enregistrer un commentaire