@nrwl/react-native:bundle
JS Bundle target options.
Options can be configured in project.json
when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.
project.json
:
{
"name": "mobile",
//...
"targets": {
//...
"bundle-ios": {
"executor": "@nrwl/react-native:bundle",
"outputs": ["{projectRoot}/build"],
"options": {
"entryFile": "src/main.tsx",
"platform": "ios",
"bundleOutput": "dist/apps/mobile/ios/main.jsbundle"
}
},
"bundle-android": {
"executor": "@nrwl/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"platform": "android",
"bundleOutput": "dist/apps/mobile/android/main.jsbundle"
}
}
}
}
nx run mobile:bundle-ios
nx run mobile:bundle-android
Examples
The sourcemapOutput
option allows you to specify the path of the source map relative to app folder:
"bundle-ios": {
"executor": "@nrwl/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"platform": "ios",
"bundleOutput": "dist/apps/mobile/ios/main.jsbundle",
"sourcemapOutput": "../../dist/apps/mobile/ios/main.map",
}
},
"bundle-android": {
"executor": "@nrwl/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"platform": "android",
"bundleOutput": "dist/apps/mobile/android/main.jsbundle",
"sourcemapOutput": "../../dist/apps/mobile/android/main.map",
}
}