JSX Transformer: Add 'jsxPragma' option
This commit is contained in:
parent
e0297e08b8
commit
4988a27b6c
@ -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"
|
||||
},
|
||||
|
||||
@ -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];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user