Skip to content

Commit

Permalink
Read source map from TMPDIR in Xcode build phase
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Feb 11, 2021
1 parent f59122d commit 8069d1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/react-native/bugsnag-react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ if [ ! -f "$BUNDLE_FILE" ]; then
exit 0
fi

MAP_FILE="$BUNDLE_FILE.map"
# Generate a stable unique path that does not contain spaces, for compatibility with react-native-xcode.sh
UID=$(md5 -qs "$CONFIGURATION_BUILD_DIR")
MAP_FILE="$TMPDIR/$UID-main.jsbundle.map"
if [ ! -f "$MAP_FILE" ]; then
echo "Warning: $MAP_FILE could not be found, falling back to $BUNDLE_FILE.map"
# Older versions of the Xcode build phase used this location
MAP_FILE="$BUNDLE_FILE.map"
fi
if [ ! -f "$MAP_FILE" ]; then
echo "Error: Source map main.jsbundle.map could not be found."
echo "Ensure the --sourcemap-output option is passed to the react-native bundle command."
Expand Down

0 comments on commit 8069d1a

Please sign in to comment.