How can I run multiple npm scripts in parallel?

后端 未结 22 2580
灰色年华
灰色年华 2020-11-22 05:48

In my package.json I have these two scripts:

  \"scripts\": {
    \"start-watch\": \"nodemon run-babel index.js\",
    \"wp-server\": \"webpack-         


        
22条回答
  •  暖寄归人
    2020-11-22 06:08

    If you're using an UNIX-like environment, just use & as the separator:

    "dev": "npm run start-watch & npm run wp-server"
    

    Otherwise if you're interested on a cross-platform solution, you could use npm-run-all module:

    "dev": "npm-run-all --parallel start-watch wp-server"
    

提交回复
热议问题