RN嵌入現有的app

1、cocopods的時候,配置 $(inherited)

2、配置 info.plist文件,

3、在本地跑項目的時候,先開啓服務器

cd ****(RN目錄)

npm start

4、跑release環境的時候,要先打包bundle

在React Native項目的根目錄下執行:

react-native bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ./ios/bundle/index.ios.jsbundle --assets-dest ./ios/bundle

我們的項目打release用的是下面這個命令,增加了一下 heap size,不然容易出錯

node --expose-gc --max_old_space_size=16000 ./node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ./ios/bundle/index.ios.jsbundle --assets-dest ./ios/bundle

資料:https://www.devio.org/2020/03/15/React-Native-releases-packaged-iOS-apps-for-apps/

          https://www.jianshu.com/p/ce71b4a8a246

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章