npm scripts设置环境变量方法

windows

set NODE_ENV=production

"scripts": {
    "release": "set NODE_ENV=production && gulp rtm",
    "dev": "set NODE_ENV=development && gulp watch",
}

linux&mac

export NODE_ENV=production

"scripts": {
    "release": "NODE_ENV=production gulp rtm",
    "dev": "NODE_ENV=development gulp watch",
}

posted @ 2019-07-06 20:34  raindi  阅读(1045)  评论(0编辑  收藏  举报