Gathering detailed insights and metrics for @rnx-kit/babel-preset-metro-react-native
Gathering detailed insights and metrics for @rnx-kit/babel-preset-metro-react-native
Gathering detailed insights and metrics for @rnx-kit/babel-preset-metro-react-native
Gathering detailed insights and metrics for @rnx-kit/babel-preset-metro-react-native
Modern, scalable tools. Exceptional developer experience.
npm install @rnx-kit/babel-preset-metro-react-native
Typescript
Module System
Min. Node Version
Node Version
NPM Version
70.2
Supply Chain
81.8
Quality
79.9
Maintenance
100
Vulnerability
97.9
License
@rnx-kit/react-native-host@0.5.8
Updated on May 06, 2025
@rnx-kit/react-native-host@0.5.7
Updated on May 05, 2025
@rnx-kit/react-native-host@0.5.6
Updated on Apr 29, 2025
@rnx-kit/yarn-plugin-external-workspaces@0.1.1
Updated on Apr 29, 2025
@rnx-kit/yarn-plugin-install-to@0.2.0
Updated on Apr 29, 2025
@rnx-kit/tools-packages@0.1.1
Updated on Apr 08, 2025
TypeScript (71.23%)
JavaScript (16.75%)
Kotlin (2.31%)
MDX (2.24%)
Objective-C (1.73%)
Swift (1.42%)
Objective-C++ (1.33%)
Rust (1.24%)
CSS (0.49%)
Ruby (0.46%)
C++ (0.42%)
Shell (0.25%)
C (0.12%)
Total Downloads
2,736,788
Last Day
2,152
Last Week
10,029
Last Month
41,800
Last Year
631,222
MIT License
1,618 Stars
3,275 Commits
100 Forks
18 Watchers
13 Branches
10,000 Contributors
Updated on May 09, 2025
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
@rnx-kit/babel-preset-metro-react-native@2.0.0
Unpacked Size
11.95 kB
Size
3.84 kB
File Count
3
NPM Version
10.8.2
Node Version
20.17.0
Published on
Sep 11, 2024
Cumulative downloads
Total Downloads
Last Day
88.6%
2,152
Compared to previous day
Last Week
2.3%
10,029
Compared to previous week
Last Month
-1.8%
41,800
Compared to previous month
Last Year
-51.1%
631,222
Compared to previous year
2
5
@rnx-kit/babel-preset-metro-react-native
provides a Babel preset for React
Native applications that you can use as a drop-in replacement for
metro-react-native-babel-preset
).
Add @rnx-kit/babel-preset-metro-react-native
to your babel.config.js
:
1module.exports = { 2 presets: ["@rnx-kit/babel-preset-metro-react-native"], 3};
If you want to add additional plugins, you can pass an options object:
1module.exports = { 2 presets: [ 3 [ 4 "@rnx-kit/babel-preset-metro-react-native", 5 { 6 additionalPlugins: ["const-enum"], 7 }, 8 ], 9 ], 10};
If you're looking to reduce the bundle size, here are a couple of things you can try.
Since 7.13.0, Babel can make certain assumptions about your code to reduce the amount of generated code. You can read more about it in Compiler assumptions.
If you make heavy use of classes, but can't use compiler assumptions, you can
enable looseClassTransform
to remove helper functions:
1module.exports = { 2 presets: [ 3 [ 4 "@rnx-kit/babel-preset-metro-react-native", 5 { 6 looseClassTransform: true, 7 }, 8 ], 9 ], 10};
This is equivalent to passing
{ loose: true }
to @babel/plugin-transform-classes
.
In your metro.config.js
, enable experimentalImportSupport
:
1module.exports = { 2 transformer: { 3 getTransformOptions: async () => ({ 4 transform: { 5 experimentalImportSupport: true, 6 inlineRequires: true, 7 }, 8 }), 9 }, 10};
And disable import/export transformation in your babel.config.js
:
1module.exports = { 2 presets: [ 3 [ 4 "@rnx-kit/babel-preset-metro-react-native", 5 { disableImportExportTransform: true }, 6 ], 7 ], 8};
Doing this will help the minifier strip out some unused code, but make sure that your app still works after enabling it.
babel-plugin-lodash
If you're using Lodash, you can get some reduction with
babel-plugin-lodash. Add it to
your babel.config.js
like below:
1module.exports = { 2 presets: ["@rnx-kit/babel-preset-metro-react-native"], 3 plugins: ["lodash"], 4};
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
SAST tool is not run on all commits -- score normalized to 9
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
binaries present in source code
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More