study umi of mutiple environment

study umi of mutiple environment

first you must install thec command

npm i cross-env -g

then you can use

“pre”: “cross-env UMI_ENV=pre umi dev”,
“build”: “cross-env UMI_ENV=proo umi build”,

if you config as below; umi will load umirc.${UMI_ENV}.ts

But it will load umirc.prod.ts as you run umi build;
umi will merge umirc.prod.ts and umirc.ts width umirc.prod.ts as the main one;
you can regard

umirc.ts
as the default configrable file; it has low priority

Leave a Reply

Your email address will not be published. Required fields are marked *