Search code examples
react-nativeexpobundlecode-push

Can Expo[51] Bare Workflow App Run a Bundle Generated from react-native bundle Command?


I’m working with an ejected Expo SDK 51 app (bare workflow) and I want to bundle my JavaScript code using the react-native bundle command instead of the default Expo bundling process. (npx expo export)

  • Expo SDK: 51
  • React Native: 0.74.3
  • JavaScript Engine: JSC (JavaScriptCore, not Hermes)
  • Workflow: Bare (ejected from Expo)
  • Bundling Command: I would like to generate the JavaScript bundle using the following command:
react-native bundle --entry-file index.js --bundle-output ./output/main.jsbundle --platform ios --dev false --assets-dest ./output

My Question:

  • Is it possible for my Expo app (running JSC) to correctly load and run a JavaScript bundle generated by the react-native bundle command, instead of using expo export or expo publish?
  • If so, are there any additional steps or configurations I need to take into account when running this manually generated bundle in the Expo environment?

Any advice or clarification on this would be much appreciated. Thanks!


Solution

  • Yes, ejected Expo SDK 51 app (bare workflow) can run a JavaScript bundle generated by the react-native bundle command.

    Should make sure that:

    • Loading the bundle correctly on the AppDelegate.m file:
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];