支持类似 Vue CLI 的环境变量 #9704
em2046
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
类似 Vue CLI https://cli.vuejs.org/zh/guide/mode-and-env.html#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F
支持项目根目录中放置下列文件来指定环境变量
在其中配置TARO_APP_开头的变量,并静态地嵌入到客户端侧的代码中
譬如在
.env.staging
中配置:然后在构建时指定环境:
build --mode staging
使用
process.env.TARO_APP_NOT_SECRET_CODE
来获取到some_value
的值Beta Was this translation helpful? Give feedback.
All reactions