Skip to content

feat: allow to specify JSX Runtime for @babel/preset-react` #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
refactor: add jsdoc for jsxRuntime option
  • Loading branch information
satya164 committed Nov 21, 2024
commit 33d18ee041ebf5ff505fbb2769b383070f4ee449
4 changes: 3 additions & 1 deletion packages/react-native-builder-bob/babel-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const browserslist = require('browserslist');
* Babel preset for React Native Builder Bob
* @param {'commonjs' | 'preserve'} options.modules - Whether to compile modules to CommonJS or preserve them
* @param {Boolean} options.esm - Whether to output ES module compatible code, e.g. by adding extension to import/export statements
* @param {'automatic' | 'classic'} options.jsxRuntime - Which JSX runtime to use, defaults to 'automatic'
*/
module.exports = function (api, options, cwd) {
const cjs = options.modules === 'commonjs';
Expand Down Expand Up @@ -37,7 +38,8 @@ module.exports = function (api, options, cwd) {
[
require.resolve('@babel/preset-react'),
{
runtime: options.jsxRuntime || 'automatic',
runtime:
options.jsxRuntime !== undefined ? options.jsxRuntime : 'automatic',
},
],
require.resolve('@babel/preset-typescript'),
Expand Down
Loading