Skip to content

Commit

Permalink
Only update bundle filename for android and ios
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed Jun 13, 2023
1 parent 85ad9e8 commit 93f8b9f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/js/integrations/rewriteframes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Platform } from 'react-native';

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

const ANDROID_DEFAULT_BUNDLE_NAME = 'app:///index.android.bundle';
const IOS_DEFAULT_BUNDLE_NAME = 'app:///main.jsbundle';

/**
* Creates React Native default rewrite frames integration
* which appends app:// to the beginning of the filename
Expand All @@ -28,8 +31,13 @@ export function createReactNativeRewriteFrames(): RewriteFrames {
}

// Expo adds hash to the end of bundle names
if (isExpo()) {
frame.filename = Platform.OS === 'android' ? 'app:///index.android.bundle' : 'app:///main.jsbundle';
if (isExpo() && Platform.OS === 'android') {
frame.filename = ANDROID_DEFAULT_BUNDLE_NAME;
return frame;
}

if (isExpo() && Platform.OS === 'ios') {
frame.filename = IOS_DEFAULT_BUNDLE_NAME;
return frame;
}

Expand Down

0 comments on commit 93f8b9f

Please sign in to comment.