study umi of mutiple environment

zhangwuji

Zhangwuji

Posted on May 5, 2024

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

💖 💪 🙅 🚩
zhangwuji
Zhangwuji

Posted on May 5, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related