Skip to content

Commit

Permalink
Add CLI support for jsx pragmas (#321)
Browse files Browse the repository at this point in the history
closes #319
  • Loading branch information
jozanza authored and alangpierce committed Oct 24, 2018
1 parent 228d40f commit 2cbe6fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default function run(): void {
"Use default TypeScript ESM/CJS interop strategy.",
)
.option("--enable-legacy-babel5-module-interop", "Use Babel 5 ESM/CJS interop strategy.")
.option("--jsx-pragma <string>", "Element creation function, defaults to `React.createElement`")
.option("--jsx-fragment-pragma <string>", "Fragment component, defaults to `React.Fragment`")
.parse(process.argv);

if (!commander.outDir) {
Expand Down Expand Up @@ -57,6 +59,8 @@ export default function run(): void {
transforms: commander.transforms.split(","),
enableLegacyTypeScriptModuleInterop: commander.enableLegacyTypescriptModuleInterop,
enableLegacyBabel5ModuleInterop: commander.enableLegacyBabel5ModuleInterop,
jsxPragma: commander.jsxPragma || "React.createElement",
jsxFragmentPragma: commander.jsxFragmentPragma || "React.Fragment",
},
};

Expand Down

0 comments on commit 2cbe6fc

Please sign in to comment.