Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 5 .changeset/odd-mayflies-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'microbundle': patch
---

Documenting --jsxFragment flag
1 change: 1 addition & 0 deletions 1 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ Options
--sourcemap Generate source map (default true)
--raw Show raw byte size (default false)
--jsx A custom JSX pragma like React.createElement (default: h)
--jsxFragment A custom JSX fragment pragma like React.Fragment (default: Fragment)
--jsxImportSource Declares the module specifier to be used for importing jsx factory functions
--tsconfig Specify the path to a custom tsconfig.json
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
Expand Down
12 changes: 4 additions & 8 deletions 12 src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,8 @@ function createConfig(options, entry, format, writeMeta) {
declarationDir: getDeclarationDir({ options, pkg }),
}),
jsx: 'preserve',
jsxFactory:
// TypeScript fails to resolve Fragments when jsxFactory
// is set, even when it's the same as the default value.
options.jsx === 'React.createElement'
? undefined
: options.jsx || 'h',
jsxFactory: options.jsx,
jsxFragmentFactory: options.jsxFragment,
},
files: options.entries,
},
Expand Down Expand Up @@ -579,8 +575,8 @@ function createConfig(options, entry, format, writeMeta) {
modern,
compress: options.compress !== false,
targets: options.target === 'node' ? { node: '8' } : undefined,
pragma: options.jsx || 'h',
pragmaFrag: options.jsxFragment || 'Fragment',
pragma: options.jsx,
pragmaFrag: options.jsxFragment,
typescript: !!useTypescript,
jsxImportSource: options.jsxImportSource || false,
},
Expand Down
5 changes: 5 additions & 0 deletions 5 src/prog.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export default handler => {
.example("watch --no-sourcemap # don't generate sourcemaps")
.option('--raw', 'Show raw byte size', false)
.option('--jsx', 'A custom JSX pragma like React.createElement', 'h')
.option(
'--jsxFragment',
'A custom JSX fragment pragma like React.Fragment',
'Fragment',
)
.option(
'--jsxImportSource',
'Declares the module specifier to be used for importing jsx factory functions',
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.