Skip to content

Commit 93f8b9f

Browse files
Only update bundle filename for android and ios
1 parent 85ad9e8 commit 93f8b9f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/js/integrations/rewriteframes.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { Platform } from 'react-native';
44

55
import { isExpo } from '../utils/environment';
66

7+
const ANDROID_DEFAULT_BUNDLE_NAME = 'app:///index.android.bundle';
8+
const IOS_DEFAULT_BUNDLE_NAME = 'app:///main.jsbundle';
9+
710
/**
811
* Creates React Native default rewrite frames integration
912
* which appends app:// to the beginning of the filename
@@ -28,8 +31,13 @@ export function createReactNativeRewriteFrames(): RewriteFrames {
2831
}
2932

3033
// Expo adds hash to the end of bundle names
31-
if (isExpo()) {
32-
frame.filename = Platform.OS === 'android' ? 'app:///index.android.bundle' : 'app:///main.jsbundle';
34+
if (isExpo() && Platform.OS === 'android') {
35+
frame.filename = ANDROID_DEFAULT_BUNDLE_NAME;
36+
return frame;
37+
}
38+
39+
if (isExpo() && Platform.OS === 'ios') {
40+
frame.filename = IOS_DEFAULT_BUNDLE_NAME;
3341
return frame;
3442
}
3543

0 commit comments

Comments
 (0)