For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /docs/migration-guides/repack-v5.md.

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

{
  "devDependencies": {
-    "@callstack/repack": "5.x.x"
+    "@callstack/repack": "^6.0.0"
  }
}

Update the Re.Pack plugins you use (@callstack/repack-plugin-*) to the same major version.

Minimum supported versions

DependencyRe.Pack 5Re.Pack 6
Node.js>=18>=22.12
React Native>=0.74>=0.82
@rspack/core>=1>=2
@module-federation/enhanced>=0.6.10>=2.0.0
react-native-reanimated>=3>=4

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:

{
  "devDependencies": {
-    "@rspack/core": "^1.0.0",
+    "@rspack/core": "^2.0.0",
-    "@swc/helpers": "^0.5.13"
+    "@swc/helpers": "^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.parallelLoader was removed, and Re.Pack no longer sets it. Loaders run in parallel when their rule sets parallel: true, as the Re.Pack templates already do. The hideParallelModeWarning option of @callstack/repack/babel-swc-loader was removed together with the warning.

  • experiments.cache moved to the top-level cache option. Move a persistent cache config there; --reset-cache reads it from the new location, and REPACK_EXPERIMENTAL_CACHE sets it there too.

    - experiments: {
    -   cache: { type: 'persistent' },
    - },
    + cache: { type: 'persistent' },

Re.Pack also adjusts two Rspack 2 defaults for you:

  • module.parser.javascript.exportsPresence is 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_PROFILE traces to the logger layer by default, because published Rspack 2 binaries don't include the perfetto layer.

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:

  resolve: {
-   ...Repack.getResolveOptions(),
+   ...Repack.getResolveOptions({ enablePackageExports: false }),
  },

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_NATIVE and Federated.createRemote from @callstack/repack
  • Federated.createURLResolver and Federated.importModule from @callstack/repack/client

Removed deprecated APIs

ChunksToHermesBytecodePlugin

Use HermesBytecodePlugin instead. The options are the same.

- new Repack.plugins.ChunksToHermesBytecodePlugin({ ... })
+ new Repack.plugins.HermesBytecodePlugin({ ... })

getPublicPath

Remove the call. Re.Pack configures output.publicPath out of the box.

  output: {
-   publicPath: Repack.getPublicPath({ platform, devServer }),
  },

--webpackConfig CLI option

Use --config instead.

- react-native start --webpackConfig webpack.config.js
+ react-native start --config webpack.config.js

@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.

react-native.config.js
module.exports = {
-  commands: require('@callstack/repack/commands/rspack'),
+  commands: require('@callstack/repack/commands'),
};

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.

Need React or React Native expertise you can count on?