cross-env 的作用

该命令是在node_modulesbin目录下,类似的脚本有cross-envcross-env-shell,在cross-env脚本中的内容如下:

#!/usr/bin/env node
'use strict';

var crossEnv = require('..');

crossEnv(process.argv.slice(2));

会把node_modules/bin的命令添加到环境变量中,比如:

    "start": "cross-env ESLINT=none PORT=3001  NO_PROXY=true roadhog dev",

cross-env的功能解决跨平台的环境变量的问题。。

cross-env makes it so you can have a single command without worrying about setting or using the environment variable properly for the platform. Just set it like you would if it's running on a POSIX system, and cross-env will take care of setting it properly.
上一篇:CSCI 3136: Principles of Programming


下一篇:16.2.2 发送 SMTP 的“Hello”消息