如何同时运行多个npm脚本? [英] How can I run multiple npm scripts at the same time?

查看:85
本文介绍了如何同时运行多个npm脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的package.json中,我定义了两个脚本.如何同时运行它们?

In my package.json, I defined two scripts. How do I run them at the same time?

"scripts": {
    "server": "webpack-dev-server",
    "webpack": "webpack -wd",
},

推荐答案

通过npm调用脚本,该脚本运行&用于并行执行或与&&用于顺序执行:

Invoke scripts via npm run with & for parallel execution or with && for sequential execution:

npm run server & npm run webpack

说明:

Use &&  for sequential execution.
Use &  for parallel execution.

这篇关于如何同时运行多个npm脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆