-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (20 loc) · 811 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var Filter = require("broccoli-filter");
var convertTemplateToReact = require("react-templates/src/reactTemplates").convertTemplateToReact;
function ReactTemplatesFilter(inputTree, options) {
if (!(this instanceof ReactTemplatesFilter)) {
return new ReactTemplatesFilter(inputTree, options);
}
Filter.call(this, inputTree, options);
this.options = options || {};
}
ReactTemplatesFilter.prototype = Object.create(Filter.prototype);
ReactTemplatesFilter.prototype.constructor = ReactTemplatesFilter;
ReactTemplatesFilter.prototype.targetExtension = "js";
ReactTemplatesFilter.prototype.processString = function(string) {
return convertTemplateToReact(string, {
modules: "es6",
name: "template",
defines: {}
});
};
module.exports = ReactTemplatesFilter;