Friday 15 August 2014

ember.js - Ember CLI - Exporting compiled Coffeescript (or transpiled Javascript) to the global namespace? -



ember.js - Ember CLI - Exporting compiled Coffeescript (or transpiled Javascript) to the global namespace? -

we're trying migrate our legacy project ember cli/ember app kit structures using es6 modules, have legacy coffeescript files need run outside ember app context. we're attempting include coffeescript files in broccoli asset pipeline using 'ember-cli-coffeescript' ember plugin/npm module.

the coffeescripts seem compile if add together line bottom of each file specifying es6 modules them so:

`export default modulevariable`

this line adds them rest of transpiled ember code , without coffeescript not seem compiled @ all. fine, adding line wraps them in amd style modules, 1 might expect. there way export them outside of amd module using ember-cli code run when after browser loads it?

it seems best way handle in ember-cli convention utilize es6 module export code above , add together line in index.html requires es6 module using traditional amd syntax like:

window.modulevariable = require('my-ember-app/module-variable')['default']

ember.js coffeescript ember-cli ecmascript-6 broccolijs

No comments:

Post a Comment