mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Use main.jsbundle in iOS template for production build (#22531)
Summary: Default HelloWorld template for iOS doesn't make production main.jsbundle. This is little bit confusing in compare with Android building app when everything works one first run. Make it seamless, reduce confuse. Based on docs https://facebook.github.io/react-native/docs/running-on-device#3-configure-app-to-use-static-bundle Fixes #22335 Fixes #18562 Pull Request resolved: https://github.com/facebook/react-native/pull/22531 Differential Revision: D13372773 Pulled By: cpojer fbshipit-source-id: 888c675b7d11b1a323445e092ec9ff83924c42f4
This commit is contained in:
committed by
Facebook Github Bot
parent
8f6521aacf
commit
a2ef5b85d8
@@ -16,7 +16,11 @@
|
||||
{
|
||||
NSURL *jsCodeLocation;
|
||||
|
||||
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||
#ifdef DEBUG
|
||||
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||
#else
|
||||
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
#endif
|
||||
|
||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
|
||||
moduleName:@"HelloWorld"
|
||||
|
||||
Reference in New Issue
Block a user