Skip to content

Instantly share code, notes, and snippets.

@thomasboyt
Created March 31, 2014 15:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomasboyt/9895275 to your computer and use it in GitHub Desktop.
Save thomasboyt/9895275 to your computer and use it in GitHub Desktop.
var Filter = require('broccoli-filter');
var compile = require('es6-arrow-function').compile;
module.exports = ArrowFunctionFilter;
ArrowFunctionFilter.prototype = Object.create(Filter.prototype);
ArrowFunctionFilter.prototype.constructor = ArrowFunctionFilter;
function ArrowFunctionFilter (inputTree, options) {
if (!(this instanceof ArrowFunctionFilter)){
return new ArrowFunctionFilter(inputTree, options);
}
this.inputTree = inputTree;
this.options = options || {};
if (this.options.extensions) {
this.extensions = options.extensions;
}
}
ArrowFunctionFilter.prototype.extensions = ['js'];
ArrowFunctionFilter.prototype.targetExtension = 'js';
ArrowFunctionFilter.prototype.processString = function (string) {
var result = compile(string);
return result;
};
@brandonparsons
Copy link

How can I integrate this into ember-cli ? (Totally new to broccoli....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment