Comments (1)
记录一下解决过程, 给有需要的同学, react native版本0.73
关于源代码相同情况下code-push-cli生成的bundle与xcode或者android编译生成的bundle不一致
以下code-push-cli特指@shm-open/code-push-cli
- 启用hermes的时候,生成packager bundle的时候,不需要压缩, 所以code-push-cli需要加上参数
--minify false
- code-push-cli需要根据
Podfile
中hermes_enabled
来判断是否开启hermes,但当前版本的react native已经不是根据这个参数来了,需要手动加上 - android build的时候packager生成的sourcemap名称是index.android.packager.map,因此需要给code-push-cli加上参数
--sourcemap-output
- ios build的时候默认不生成sourcemap,但在不开启sourcemap的情况下hermers编译器生成的bytecode会随着bundle的路径不同而不同,开启sourcemap后,又与bundle的路径无关,真的令人匪夷所思,所以解决方式就是生成sourcemap,做法就是在
xcode.env
内导出环境变量SOURCEMAP_FILE
export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.packager.map"
但是xcode编译完后,又会删除sourcemap,而code-push-cli会保留sourcemap并且会上传热更新服务器,这又会触发第一次热更新,调整就是不让code-push-cli上传sourcemap,而且确实没有必要
code-push-cli
默认会上传CodePush目录下的所有文件, 因为如果我们要生成sourcemap,就不要把sourcemap放在CodePush下面
from code-push-cli.
Related Issues (8)
- 关于codepush的请教 HOT 1
- Dependency Dashboard
- 版本判断问题 HOT 3
- 无法注册 HOT 1
- code-push-cli docker 镜像 使用报错 HOT 1
- 推送的新包,在更新上提示无法解压
- 发布更新失败 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-push-cli.