在我的package.json我有这两个脚本:
"scripts": {
"start-watch": "nodemon run-babel index.js",
"wp-server": "webpack-dev-server",
}
Run Code Online (Sandbox Code Playgroud)
每次我开始在Node.js中开发时,我必须并行运行这两个脚本.我想到的第一件事就是添加第三个脚本:
"dev": "npm run start-watch && npm run wp-server"
Run Code Online (Sandbox Code Playgroud)
......但是start-watch在运行之前会等待完成wp-server.
我怎样才能并行运行这些?请记住,我需要查看output这些命令.此外,如果您的解决方案涉及构建工具,我宁愿使用gulp而不是grunt因为我已经在另一个项目中使用它.