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

yjz1004 picture yjz1004  ·  3Comments

renyi818 picture renyi818  ·  3Comments

cheung1111 picture cheung1111  ·  3Comments

happier2 picture happier2  ·  3Comments

yadongxie150 picture yadongxie150  ·  3Comments