主要是方便我们写前端工程化的时候,我们可以同时启动多个命令用。
1、安装concurrently
2、package.json

文档地址:https://www.npmjs.com/package/concurrentl

一、安装


//使用node编写时
npm install -g concurrently
//或者cnpm在项目里
cnpm install concurrently --save

二、package.json

scripts:{
  "watch-start":"...",
  "watch-server":"...",
  "watch-dreams":"..."
}

三、命令行启动

//命令带上引号
concurrently "npm run dev" "npm run build" "npm run server"
//或者运行某字段为前缀的命令
concurrently "npm:watch-*"

来源链接:https://zhuanlan.zhihu.com/p/65564606
来源:知乎