ember.js - How to import non amd library ember-cli -
i using ember-cli , faced problem of importing amplifyjs in project. downloaded amplify using bower library not in es6 format. therefore, when try use in project, can't import it.
basically want do:
import amplify amplify; //use amplify here
brocfile.js
app.import('bower_components/amplify/lib/amplify.js');
since lot of libraries no in es6 format yet, question is: "is there way import or use es5 librairies in es6".
if not, recommended way of doing in ember?
you can't import amplify amplify;
because it's not module.
you've got don't try import library. need reference global way outside of ember-cli app.
from docs:
provide asset path first , argument:
app.import('bower_components/moment/moment.js');
from here use package specified it’s documentation, global variable. in case be:
import ember 'ember'; /* global moment */ // no import moment, it's global called `moment` // ... var day = moment('dec 25, 1995');
note: don’t forget make jshint happy adding
/* global my_global */
module, or defining within predefs section of .jshintrc file.
Comments
Post a Comment