How can I run multiple npm scripts in parallel?

后端 未结 22 2493
灰色年华
灰色年华 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:29

    I ran into problems with & and |, which exit statuses and error throwing, respectively.

    Other solutions want to run any task with a given name, like npm-run-all, which wasn't my use case.

    So I created npm-run-parallel that runs npm scripts asynchronously and reports back when they're done.

    So, for your scripts, it'd be:

    npm-run-parallel wp-server start-watch

提交回复
热议问题