From be8d16d8c6601a34ec76c2553d737c7bed7e0a79 Mon Sep 17 00:00:00 2001 From: Stefan Dobrev Date: Fri, 10 Mar 2017 18:26:24 +0200 Subject: [PATCH] Add extensibility point for passing additional args to packager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend `react-native-xcode.sh` to allow passing of additional args to bundle command. This is useful if you want to generate source maps for example. Here is an example that modifies the “Bundle React Native code and images” script phase: ```sh export NODE_BINARY=node export EXTRA_PACKAGER_ARGS="--sourcemap-output ${SRCROOT}/build/main.jsbundle.map" ./react-native-xcode.sh ``` Android’s `build.gradle` already have this extensibility point in the name of: ```gradle project.ext.react = [ extraPackagerArgs: [ ] ] ``` --- packager/react-native-xcode.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packager/react-native-xcode.sh b/packager/react-native-xcode.sh index d136282fdd683d..3cdc723f46bef2 100755 --- a/packager/react-native-xcode.sh +++ b/packager/react-native-xcode.sh @@ -91,7 +91,8 @@ $NODE_BINARY "$REACT_NATIVE_DIR/local-cli/cli.js" bundle \ --dev $DEV \ --reset-cache \ --bundle-output "$BUNDLE_FILE" \ - --assets-dest "$DEST" + --assets-dest "$DEST" \ + $EXTRA_PACKAGER_ARGS if [[ ! $DEV && ! -f "$BUNDLE_FILE" ]]; then echo "error: File $BUNDLE_FILE does not exist. This must be a bug with" >&2