Ant-design-pro: 🧐[问题] How to modify Config for different Environments?

Created on 7 Jul 2020  ·  1Comment  ·  Source: ant-design/ant-design-pro

Hello,

In the UMI.js docs there's many ways to make config values. You can use config/config.ts (Which ant design pro uses) or you can use a .umirc.ts. If you use .umirc.ts, you can also use .umirc. UMI_ENV.ts and those settings will be merged in if the UMI_ENV env variable matches.

However, I tested and in ant design pro UMI_ENV has no value. Can I use .umirc.ts files for config? Can I use REACT_APP_ENV to choose different values to merge?

If not, is there any way of having different config values for different environments?

My goal is to have npm start use the mock api responses, and npm run dev use a real api server running locally. For this I must configure all API calls to use the URL of that api server. Then for Production I must be able to instead set the env variables to the production server location.

Inactive 🕵🏻‍♀️ question

Most helpful comment

maybe _cross-env_ is what u looking for

>All comments

maybe _cross-env_ is what u looking for

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wuyongdec picture wuyongdec  ·  3Comments

kaoding picture kaoding  ·  3Comments

gaoqiang19514 picture gaoqiang19514  ·  3Comments

952425340 picture 952425340  ·  3Comments

suifan picture suifan  ·  3Comments