Migrating from Metro
If the automatic migration using @callstack/repack-init didn't work for any reason,
or if you have custom project structure, you can follow these manual migration steps:
1. Dependencies
Install required dependencies in your project:
This will install the latest versions of your chosen bundler and necessary dependencies for code optimization and minification.
Once the dependencies are installed, you need to tell React Native Community CLI to add Re.Pack's commands.
2. Commands
Add the following content to react-native.config.js (or create it if it doesn't exist):
This will allow you to use Re.Pack when running react-native start and react-native bundle commands.
3. Configuration
Pick one of the templates below and create configuration file in the root directory of your project. The name of the file should be identical to the one on top of the template e.g. rspack.config.mjs.
We recommend to use ESM version of Rspack/webpack config with the .mjs extension. However, Re.Pack also supports ESM under .js and CJS variant under .js and .cjs extensions. Check our templates for CJS and ESM variants as well as the documentation on Configuration to see the list of all available Rspack/webpack config location and extensions.
4. Configure XCode
When building release version of your application XCode project will still use Metro to bundle the application, so you need to adjust build settings to make XCode use Re.Pack instead.
Open your application's Xcode project/workspace and:
- Click on the project in Project navigator panel on the left
- Go to Build Phases tab
- Expand Bundle React Native code and images phase
- Add following content to the phase:
After the change, the content of this phase should look similar to:
5. Install CocoaPods dependencies
For iOS development, you need to install CocoaPods dependencies. From the project root directory run:
This will install all the necessary iOS dependencies for your project, including the Re.Pack native module.
You've successfully set up Re.Pack in your project. We highly recommend to check out the following:
- Configuration Guide to learn how to configure Re.Pack to your project needs.
- API Reference to learn more about Re.Pack's API.


