Migrating from Re.Pack 5
Re.Pack 6 raises the minimum supported versions of Node.js, React Native, Rspack, Module Federation and Reanimated, and removes APIs that were deprecated in Re.Pack 5.
Update dependencies in package.json
Update the Re.Pack plugins you use (@callstack/repack-plugin-*) to the same major version.
Minimum supported versions
The legacy architecture is no longer supported
React Native 0.82 removed the legacy architecture, so Re.Pack's native module is now built only as a TurboModule. If your app still sets newArchEnabled=false, migrate it to the New Architecture before upgrading.
Rspack 2 is required
Re.Pack 6 supports Rspack 2 only. webpack projects are not affected. Update @rspack/core along with @swc/helpers, which Rspack 2 needs at ^0.5.23:
Read Rspack's Upgrading from v1 to v2 guide for changes to your own config. The ones that most often affect React Native projects:
-
experiments.parallelLoaderwas removed, and Re.Pack no longer sets it. Loaders run in parallel when their rule setsparallel: true, as the Re.Pack templates already do. ThehideParallelModeWarningoption of@callstack/repack/babel-swc-loaderwas removed together with the warning. -
experiments.cachemoved to the top-levelcacheoption. Move a persistent cache config there;--reset-cachereads it from the new location, andREPACK_EXPERIMENTAL_CACHEsets it there too.
Re.Pack also adjusts two Rspack 2 defaults for you:
module.parser.javascript.exportsPresenceis set to'auto', so imports of missing exports, which some React Native libraries ship, are warnings instead of build errors. Override it in your config to make them errors again.RSPACK_PROFILEtraces to theloggerlayer by default, because published Rspack 2 binaries don't include theperfettolayer.
Package exports are enabled by default
getResolveOptions() now sets enablePackageExports to true by default, matching Metro's default since React Native 0.79. Configs that already pass enablePackageExports: true don't need changes. If your project relies on main-field resolution, opt out explicitly:
See Module Resolution for how package exports change resolution.
Module Federation V1 was removed
ModuleFederationPluginV1 is no longer available, and Repack.plugins.ModuleFederationPlugin now points to ModuleFederationPluginV2. Follow Migrating from V1 to move your configs to Module Federation 2.0.
The Federated helpers, which only worked with V1, were removed as well:
Federated.SHARED_REACT,Federated.SHARED_REACT_NATIVEandFederated.createRemotefrom@callstack/repackFederated.createURLResolverandFederated.importModulefrom@callstack/repack/client
Removed deprecated APIs
ChunksToHermesBytecodePlugin
Use HermesBytecodePlugin instead. The options are the same.
getPublicPath
Remove the call. Re.Pack configures output.publicPath out of the box.
--webpackConfig CLI option
Use --config instead.
@callstack/repack/commands/rspack and @callstack/repack/commands/webpack
Use the unified commands. They pick the bundler based on the config file name, or the --bundler option.
OutputPlugin output options
output.bundleFilename, output.sourceMapFilename and output.assetsPath had no effect since Re.Pack 5 and are now rejected by OutputPlugin's option validation. Remove them and use the --bundle-output, --sourcemap-output and --assets-dest CLI options instead.
reanimatedModuleRules from @callstack/repack-plugin-reanimated
Use reanimated4ModuleRules instead. reanimatedModuleRules was an alias of reanimated3ModuleRules, which was removed together with Reanimated 3 support (see below).
Reanimated 3 support in @callstack/repack-plugin-reanimated
Reanimated 3 doesn't support React Native 0.82 or newer, so ReanimatedPlugin now requires react-native-reanimated 4 together with react-native-worklets, and reanimated3ModuleRules was removed. Follow the Reanimated 4 migration guide, then replace react-native-reanimated/plugin with react-native-worklets/plugin in your Babel config.


