JSX Transformer: Add 'jsxPragma' option

This commit is contained in:
ArrestedDevelopment 2015-03-28 01:41:16 -06:00
parent e0297e08b8
commit 4988a27b6c
2 changed files with 8 additions and 1 deletions

View File

@ -83,6 +83,13 @@
"shorthand": "L"
},
"jsxPragma": {
"type": "string",
"description": "Custom pragma to use with JSX (same functionality as @jsx comments)",
"default": "React.createElement",
"shorthand": "P"
},
"ignore": {
"type": "list"
},

View File

@ -4,7 +4,7 @@ import * as t from "../../../types";
var JSX_ANNOTATION_REGEX = /^\*\s*@jsx\s+([^\s]+)/;
export function Program(node, parent, scope, file) {
var id = "React.createElement";
var id = file.opts.jsxPragma;
for (var i = 0; i < file.ast.comments.length; i++) {
var comment = file.ast.comments[i];