Passing environment variables in npm-scripts

后端 未结 3 1640
说谎
说谎 2021-02-03 17:30

I have a package.json with following (simplified) content in the scripts key:

...
scripts: {
   \"start\": \"NODE_ENV=${NODE_ENV:=production} node start-app.js\"         


        
3条回答
  •  情深已故
    2021-02-03 18:16

    If you have small use cased, use better-npm-run. For small cases, it works fine. Somehow if you have a lot of commands and it hard manage. Try, batman-cli. Work well and handle lot of environment-dependent issues

    npm i -g batman-cli

提交回复
热议问题