Ember 2.0 / ember-cli 1.13.8
I couldn't find a way to import names export from ES6 module located in ./vendor dir in my Ember 2.0 project.
- simple
import {Socket} from 'vendor/phoenix'in my Controller does not transpile the lib into ES5
app.import('vendor/phoenix.js', {exports: {phoenix: ['Socket']}})in myember-cli-build.jsdoes not transpile the lib into ES5 either.
- I have also tried http://ift.tt/1KktgVW --
- could not make it work due to named exports. (
Error: Entry module can only have named exports in strict mode (pass ``strict: true``) - When I just modify the library to use
default exportthe error went away but the library was not available for import. Looks like Broccoli didn't merge the lib into the tree.
- could not make it work due to named exports. (
here is my ember-cli-build.js :
var tree = './vendor';
var amdFiles = new ES6Modules(tree, {
format: 'amd',
bundleOptions: {
entry: 'phoenix.js',
name: 'phoenix'
}
});
return mergeTrees([app.toTree(), amdFiles]);
Aucun commentaire:
Enregistrer un commentaire