Grunt Concurrent cannot run too many tasks

流过昼夜 提交于 2019-12-12 15:09:58

问题


I'm trying to run multiple watch tasks with grunt, but it seems to not be able to. I'm using grunt concurrent, but it seems to only run a portion of the tasks I specify, stopping just short.

Here is the snippet of my gruntfile:

concurrent:
  compile:
    tasks: ["watch:app", "watch:html", "watch:images", "watch:lib", "watch:server"]
    options:
      logConcurrentOutput: true

When I run this, the output shows:

Running "concurrent:compile" (concurrent) task
Running "watch:images" (watch) task
Waiting...Running "watch:app" (watch) task
Waiting...Running "watch:html" (watch) task
Waiting...Running "watch:lib" (watch) task
Waiting...

For some reason, it's skipping my server task completely. I initially thought the server tasks was not setup correctly, but I can remove a watch task, and it will correctly run the server task along with the other 3, it just cannot run all 5 at once.

Am I implementing this inappropriately?


回答1:


So from the documentation, simply declare the amount of tasks you want. so in your case:

options:
      logConcurrentOutput: true
      limit: 5

By default it just uses how many cores your CPU has..

limit

Type: Number Default: Number of CPU cores (require('os').cpus().length) with a minimum of 2

Limit of how many tasks that are run concurrently.

https://github.com/sindresorhus/grunt-concurrent



来源:https://stackoverflow.com/questions/20865228/grunt-concurrent-cannot-run-too-many-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!