When you start a react-native app you'll see this message output by the React Packager:
Running packager on port 8081
and then:
Looking for JS files in
/Users/gbirman/gil/mapily
React packager ready.
By this point, the packager has compiled your JS files and is serving them with the .js
extension renamed to .bundle
. For example, your index.io.js
file is compiled and served from:
http://localhost:8081/index.ios.bundle
If you added another file foo.js
in the same directory as index.ios.js
, the packager would serve it from:
http://localhost:8081/foo.bundle
You can confirm this by opening that url in your browser.
Now to answer your question, your project has an iOS/AppDelegate.m
file with the following line:
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
... as you can see, it loads the index.ios.bundle
. You can change the path/filename there to whatever you want, but it's probably best to stick with the recommended approach of naming your entry file index.io.js
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…