UNPKG

561 BJavaScriptView Raw
1var curry = "(require(\"generic-jsx\").curry(_=>_))";
2var insertion = require("babylon").parse(curry).program.body[0].expression;
3
4var plugin = function plugin(options)
5{
6 var types = options.types;
7 var visitor = require("babel-helper-builder-react-jsx")(
8 {
9 pre: function(state)
10 {
11 state.args.push(state.tagExpr);
12 state.callee = insertion;
13 }
14 });
15
16 return {
17 inherits: require("babel-plugin-syntax-jsx"),
18 visitor: visitor
19 };
20}
21
22module.exports = plugin;