其他分享
首页 > 其他分享> > cross-env 的作用

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.

标签:bin,node,cross,setting,env,properly,作用
来源: https://www.cnblogs.com/bing-yu12/p/14707782.html