Skip to content

Commit

Permalink
Add support for jsxFragment in CLI (bublejs#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbolis committed Nov 20, 2019
1 parent 5195f3f commit 244155d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/runBuble.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function compileFile(from, to, command, options) {
source: from,
file: to,
jsx: options.jsx,
jsxFragment: options.jsxFragment,
objectAssign: options.objectAssign,
namedFunctionExpressions: options.namedFunctionExpressions
});
Expand Down Expand Up @@ -92,6 +93,7 @@ module.exports = function(command) {
target: {},
transforms: {},
jsx: command.jsx,
jsxFragment: command['jsx-fragment'],
objectAssign: command.objectAssign,
namedFunctionExpressions: command['named-function-expr'] !== false
};
Expand Down
1 change: 1 addition & 0 deletions test/cli/supports-jsx-fragment-pragma/command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
buble input.js -o actual/output.js --jsx-fragment NotReact.Fragment
1 change: 1 addition & 0 deletions test/cli/supports-jsx-fragment-pragma/expected/output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var img = React.createElement( NotReact.Fragment, null, React.createElement( 'img', { src: "foo.gif" }) );
1 change: 1 addition & 0 deletions test/cli/supports-jsx-fragment-pragma/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var img = <><img src="foo.gif" /></>;

0 comments on commit 244155d

Please sign in to comment.