React Native 之 main.jsbundle生成方法

来源:互联网 发布:淘宝店是怎么打广告的 编辑:程序博客网 时间:2024/06/05 14:18

坚持 成长 每日一篇

步骤:

1.在React Native项目根目录下运行 npm start

2.使用curl命令生成 main.jsbundle

curl http://localhost:8081/index.ios.bundle -o main.jsbundle

3.在AppDelegate.m中选择使用main.jsbundle
注释掉

  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

取消注释下面这一行

  // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
0 0