怎么都是这些包安装到process.env
,为什么我看不到NODE_ENV
在NPM脚本设置?
"start": "NODE_ENV=dev npm run build && npm run watch && npm run tslint"
我们高度脚本:
"scripts": {
"start": "npm run build && npm run watch && npm run tslint",
"build": "npm run build-ts",
"serve": "nodemon dist/Server.js",
"watch": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-ts\" \"npm run serve\"",
"test": "mocha --compilers ts:ts-node/register",
"build-ts": "tsc",
"watch-ts": "tsc -w",
"tslint": "tslint -c tslint.json -p tsconfig.json",
"debug": "npm run build && npm run watch-debug",
"serve-debug": "nodemon --inspect dist/Server.js",
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-ts\" \"npm run serve-debug\""
},
如何将所有这些包钻进process.env
qazxsw POI反映系统的环境变量。例如。运行process.env
。更多:env
为什么我没有看到NODE_ENV设置
根据您的指令https://nodejs.org/api/process.html#process_process_env它没有坚持以任何方式的环境,但是当NODE_ENV=dev npm run build && npm run watch && npm run tslint
运行将出席会议。
设置环境变量合适的剧本是在npm run build
:这工作"serve"
。