A Broccoli plugin which transpiles ES6 to readable ES5 by using babel.
$ npm install broccoli-babel-transpiler --save-dev
In your Brocfile.js
:
var esTranspiler = require('broccoli-babel-transpiler');
var scriptTree = esTranspiler(inputTree, options);
You can find options at babel's github repo.
Currently this plugin only supports inline source map. If you need separate source map feature, you're welcome to submit a pull request.
filterExtensions
is an option to limit (or expand) the set of file extensions that
will be transformed.
The default filterExtension
is js
var esTranspiler = require('broccoli-babel-transpiler');
var scriptTree = esTranspiler(inputTree, {
filterExtensions:['js', 'es6'] // babelize both .js and .es6 files
});