From bad39493b976b425fdf72cd8cf1543a375d612ab Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 19 Aug 2022 10:23:22 -0700 Subject: [PATCH] Cleanup temporary files after source map generation. Summary: Changelog: [iOS][Fixed] - When source maps are enabled, clean up temporary files from the build directory. Reduces bundle size by at least 1MB. Reviewed By: cipolleschi Differential Revision: D38866158 fbshipit-source-id: 0f46faf4e767bb7417b24f283fbe19cfa022941a --- scripts/react-native-xcode.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index c2152768347979..927ec76c3adc1f 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -170,6 +170,8 @@ else if [[ $EMIT_SOURCEMAP == true ]]; then HBC_SOURCEMAP_FILE="$DEST/main.jsbundle.map" "$NODE_BINARY" "$COMPOSE_SOURCEMAP_PATH" "$PACKAGER_SOURCEMAP_FILE" "$HBC_SOURCEMAP_FILE" -o "$SOURCEMAP_FILE" + rm "$HBC_SOURCEMAP_FILE" + rm "$PACKAGER_SOURCEMAP_FILE" fi BUNDLE_FILE="$DEST/main.jsbundle" fi