-
为什么运行的是 prod 配置文件而不是 stage 配置文件? "build:stage": "UMI_ENV=stage max build" yarn build:stage
|
Beta Was this translation helpful? Give feedback.
Answered by
fz6m
Sep 13, 2023
Replies: 1 comment 4 replies
-
参考 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
默认有开发和构建环境,当
umi dev
时是config.dev.ts
,当umi build
时是config.prod.ts
,当用户还希望自己新增更多环境设定时,才需要使用UMI_ENV
,此时就可以使用config.${UMI_ENV}.ts
和config.${dev | prod | test}.${UMI_ENV}.ts
,以便在不同用户自定义的环境有不同的配置(如环境变量的不同),这些配置会根据优先级进行覆盖,详见 https://umijs.org/docs/guides/env-variables#umi_env