DEV Community

Davyd NRB
Davyd NRB

Posted on • Updated on

React Native force to bundle javascript in Debug build

You can use a special env. variable on iOS

FORCE_BUNDLING=1 yarn ios
Enter fullscreen mode Exit fullscreen mode

Source: https://github.com/facebook/react-native/blob/667d85bddada31a51bcf6e05b3b042efb93ddb78/packages/react-native/scripts/react-native-xcode.sh#L39


For android edit your app's android/app/build.gradle file:

// React Native <= 0.70.x
project.ext.react = [
  // ...
  bundleInDebug: System.getenv("FORCE_BUNDLING") != null,
]

// React Native >= 0.71.x
react {
    debuggableVariants = System.getenv("FORCE_BUNDLING") ? [] : ["debug"]
}
Enter fullscreen mode Exit fullscreen mode

then you can use:

FORCE_BUNDLING=1 yarn android
Enter fullscreen mode Exit fullscreen mode

Top comments (0)