【发布时间】:2019-04-05 11:52:37
【问题描述】:
我有一个 React-Native 项目,我正在我的“staging”服务器上进行测试。现在是时候在“production”服务器上发布它了。
我正在使用 config.json 文件,其中包含服务器信息,例如 api 密钥、api 地址等。
我想要的是为“生产”和“暂存”使用不同的 config.json。当我使用生产 config.json 时,我的包中不会有暂存 config.json 的痕迹。
src
- config
-- config.js
-- production-server.json
-- staging-server.json
可能类似于:yarn build-staging、yarn build-production
【问题讨论】:
-
你确定你有 react-native 的问题吗?
react-native是关于移动开发的!不是关于服务器;-) -
是的。移动应用程序连接到 api 服务器对吗?对于暂存和生产,此服务器是不同的。
标签: react-native