Re.Pack (React Native)
Deploy your React Native applications with Module Federation to Zephyr Cloud using Re.Pack and Rspack. The Zephyr Re.Pack plugin integrates seamlessly with Re.Pack's build process and supports cross-platform mobile applications.
- Finished our Prerequisites setup guide
- Installed our Chrome extension
This detects your bundler and configures Zephyr automatically. Learn more →
For manual setup, continue below.
Installation
Install the Re.Pack plugin in your project:
Basic Setup
Add the Zephyr plugin to your Rspack configuration by wrapping it with withZephyr:
Module Federation with Re.Pack
You can continue using your existing Module Federation configuration from Re.Pack. We recommend using the new Re.Pack Module Federation as it provides better runtime support for cross-platform applications.
For detailed Re.Pack setup, refer to Re.Pack's documentation and check out Callstack's Super App Showcase for reference implementations.
Host Application (Consumer)
Remote Application (Provider)
Shared Dependencies
Configure shared dependencies to ensure single instances of critical modules like React and React Native:
Platform-Specific Builds
Re.Pack supports platform-specific builds for iOS and Android. The ${platform} variable in remote URLs automatically resolves to the target platform:
Each Zephyr version is built for one platform, and an environment serves a single version. When a host consumes per-platform environments or tags, use the ${target} selector placeholder, for example "MobileCart": "zephyr:MobileCart@production-${target}" in zephyr:dependencies. An iOS build resolves production-ios, and an Android build resolves production-android. See Per-platform selectors.
Environment Variables
withZephyr() rewrites process.env.ZE_PUBLIC_* and import.meta.env.ZE_PUBLIC_* reads in your application sources, not node_modules, into runtime lookups that fall back to the build-time value. It also injects a Module Federation runtime plugin that loads the zephyr-manifest.json next to each resolved remote and applies its values before the remote's code runs. With zephyr-native-cache registered, the last loaded values are kept for offline starts.
See Environment-Level Overrides for when dashboard changes reach installed apps.
Runtime Manifest
For an app whose bundle ships inside the store binary, set runtimeManifest so the app follows a Zephyr tag or environment at runtime instead of only its build-time remotes:
Write the selector in plain quotes, not a template literal. Selector syntax, runtime behavior, and the zephyr-native-cache requirement are the same as for Metro; see Metro: Runtime Manifest. In Re.Pack, a runtimeManifest that cannot be resolved is reported like other Zephyr configuration errors: it fails the build with ZE_FAIL_BUILD=true or in CI with ZE_CI_TOKEN, and is logged otherwise.