Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.env.development 是否可以配置为.env.dev #3

Closed
huoxudong125 opened this issue Nov 18, 2020 · 3 comments
Closed

.env.development 是否可以配置为.env.dev #3

huoxudong125 opened this issue Nov 18, 2020 · 3 comments

Comments

@huoxudong125
Copy link

huoxudong125 commented Nov 18, 2020

.env.development 是否可以配置为.env.dev.env.prod,如果能够配置那就更好了

@WellerQu
Copy link
Owner

WellerQu commented Jan 6, 2021

sorry, 还不能. 我是依照 https://create-react-app.dev/docs/adding-custom-environment-variables#what-other-env-files-can-be-used 这个文档来约定文件名的. 如果这个需求很有必要的话, 我可以改一改.

说实话, 我也觉得 .env.development 很长.

@WellerQu WellerQu closed this as completed Jan 6, 2021
@lshz0088
Copy link

@WellerQu 请问这功能有了么,我也比较需要,因为现在有很多环境的配置文件,名称都不一样。默认的不够用了

@WellerQu
Copy link
Owner

WellerQu commented Aug 4, 2021

@WellerQu 请问这功能有了么,我也比较需要,因为现在有很多环境的配置文件,名称都不一样。默认的不够用了

老铁, 不是我懒, 是您这个需求没办法满足(我理解的您的需求是需要无穷个.env文件), 但是您看到package.json文件的"extensions"节点:

"extensions": [
  ".env",
  ".development",
  ".local",
  ".test",
  ".production"
],

实际上是个有限集合. 以上述任何一个扩展名结尾都行. 我实在不敢想象, 您会有5的阶乘(5!)个环境配置文件 ? 还是我理解错了?

期待您的回复.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants