.env里声明的环境变量怎么注入到业务代码里
#16754
-
.env里声明的环境变量怎么注入到业务代码里? |
Beta Was this translation helpful? Give feedback.
Answered by
PPPeony
Oct 28, 2024
Replies: 2 comments 2 replies
-
https://docs.taro.zone/en/docs/env-mode-config/#%E9%BB%98%E8%AE%A4%E8%A1%8C%E4%B8%BA
不是 .env.dev |
Beta Was this translation helpful? Give feedback.
1 reply
-
文档上也写了3.5.10以上版本的taro才支持环境变量注入,但是我没注意看,然后项目里的版本号是精确版本号,所以怎么配环境变量也是注入不到代码里的😭 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
解决问题了,我参考的是这个帖子#14330
我将taro的版本号升级到3.6+,自定义模式的环境变量也可以注入了。