📌  相关文章
📜  如何使用特定的 .env 文件节点进行构建 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:58.958000             🧑  作者: Mango

代码示例1
npm install --save-dev env-cmd

// Then updated package.json accordingly:

"scripts": {
   "start": "react-scripts start",
   "build": "react-scripts build",
   "test": "react-scripts test",
   "eject": "react-scripts eject",
   "build:stage": "env-cmd -f ./.env.stage npm run-script build" 
}

// Then run the following command:
npm run build:stage