Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bun-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π bun-native
β‘ Use Bun as a blazing-fast package manager with React Native projects.
This tool patches Metro and handles Bun-specific quirks so you can enjoy faster installs and cleaner dependencies.
π Features
- β Metro bundler compatibility with Bun's symlinked dependencies
- β
Generates a
node_modules_mirror/for clean Metro resolution - β
Patches
metro.config.jsautomatically - β
Wrapper commands for
run-ios,run-android, andstart - β Postinstall hook support for seamless integration
π¦ Installation
Install globally via npm:
npm install -g bun-nativeMake sure you have Bun installed
curl -fsSL https://bun.sh/install | bashπ§ͺ Usage
π Initialize a New Project (React Native CLI)
bun-native initCreates a new React Native project and installs everything using Bun.
π¦ Customize the Project Name
You can pass a name to create your project:
bun-native init MyAppπ§ͺ Choose a Specific React Native Version
Use the --version flag to target a specific RN version:
bun-native init MyApp --version 0.78.1β Migrate an Existing React Native Project
cd your-react-native-app
# Clean up old installs
rm -rf node_modules package-lock.json yarn.lock
# Install dependencies with Bun
bun install
# Patch Metro + Generate node_modules
bun-native postinstall
# Run the app
bun-native start
bun-native run-ios
bun-native run-androidπ§ How It Works
β’ Uses Bunβs .bun/install/cache to generate a flat node_modules_mirror/ layout
β’ Modifies metro.config.js to resolve modules from the mirror
β’ Wraps npx react-native commands for convenienceπ Available Commands
| Command | Description |
|---|---|
init |
Initialize a new React Native project using Bun |
patch-metro |
Patch Metro to work with Bun |
postinstall |
Run postinstall to patch Metro and create mirror layout |
run-android |
Run react-native run-android |
run-ios |
Run react-native run-ios |
start |
Run react-native start |
bundle |
Run react-native bundle |
β οΈ Known Limitations
β’ Not yet compatible with all complex native modules β but works well for most.
β’ Metro doesnβt fully support Bunβs symlink layout β hence the node_modules_mirror.π€ Contributing
Pull requests are welcome! Ideas, templates, and bug reports are also appreciated.
π License
MIT Β© 2025 Kologo B Josias Yannick
Buy me a coffee
If my you find my work usefull and want to support me, kindly buy me a coffee here
