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文件 #315

Open
Yayoiqz opened this issue Oct 6, 2022 · 3 comments
Open

希望构建时可以支持指定自定义的.env文件 #315

Yayoiqz opened this issue Oct 6, 2022 · 3 comments

Comments

@Yayoiqz
Copy link

Yayoiqz commented Oct 6, 2022

目前看官网上mode参数只有development和production,.env文件支持
.env
.env.{mode}
.env.local
.env.{mode}.local
希望构建时可以支持指定自定义的.env文件,例如.env.preonline,.env.test,更方便区分环境

@otakustay
Copy link
Member

otakustay commented Oct 12, 2022

当指定--env=.env.custom时,你希望哪一种处理:

  1. 先按照默认规则把几个.env都加载好,再额外加上.env.custom
  2. 禁用默认规则,只加载.env.custom
  3. --env-append--env-only参数来区分用上面哪一个逻辑

个人先反对第3个方案

@Yayoiqz
Copy link
Author

Yayoiqz commented Oct 14, 2022

我个人倾向于第一种处理,因为之前用的是vue-cli就是这种处理,感觉更符合使用逻辑。

@otakustay
Copy link
Member

现在NodeJS原生有--env-file参数了,我会按照原生的优先级方案来实现这个功能

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

2 participants