DEV Community

Zhangwuji
Zhangwuji

Posted on

study umi of mutiple environment

first you must install thec command

 npm i cross-env -g
Enter fullscreen mode Exit fullscreen mode

then you can use

     "pre": "cross-env UMI_ENV=pre  umi dev",
    "build": "cross-env UMI_ENV=proo  umi build",
Enter fullscreen mode Exit fullscreen mode

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

Image description

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

Top comments (0)