Release mode build phase Xcode
mfbx9da4 opened this issue · 1 comments
mfbx9da4 commented
mfbx9da4 commented
I managed to get this to work
- Ensure the step is before the step "Copy bundle and resources"
- Here is my code for the actual shell script
set -e
export NODE_BINARY=node
case "$CONFIGURATION" in
*Debug*)
if [[ "$PLATFORM_NAME" == *simulator ]]; then
if [[ "$FORCE_BUNDLING" ]]; then
echo "FORCE_BUNDLING enabled; continuing to bundle."
else
echo "Skipping bundling in Debug for the Simulator (since the packager bundles for you). Use the FORCE_BUNDLING flag to change this behavior."
exit 0;
fi
else
echo "Bundling for physical device. Use the SKIP_BUNDLING flag to change this behavior."
fi
DEV=true
;;
"")
echo "$0 must be invoked by Xcode"
exit 1
;;
*)
DEV=false
;;
esac
REACT_NATIVE_DIR=../node_modules/react-native
# Find path to Node
# shellcheck source=/dev/null
source "$REACT_NATIVE_DIR/scripts/find-node.sh"
# check and assign NODE_BINARY env
# shellcheck source=/dev/null
source "$REACT_NATIVE_DIR/scripts/node-binary.sh"
node ../node_modules/react-native/local-cli/cli.js bundle --dev false --minify false --assets-dest ./ --entry-file ./index.worker.js --platform ios --bundle-output ./index.worker.jsbundle
I was inspired by how react native do this internally