Grunt Concurrent不能运行太多任务 [英] Grunt Concurrent cannot run too many tasks

查看:289
本文介绍了Grunt Concurrent不能运行太多任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用grunt运行多个watch任务,但似乎无法。我使用grunt并发,但它似乎只运行一部分任务我指定,停止只是短。



这是我的gruntfile的片段:

  concurrent:
compile:
tasks:[watch:app,watch:html watch:images,watch:lib,watch:server]
选项:
logConcurrentOutput:true

当我运行这个时,输出显示:

 运行concurrent: )task 
运行watch:images(监视)任务
等待...运行watch:app(监视)任务
等待...运行watch:html )task
Waiting ...正在运行watch:lib(watch)task
等待...

由于某种原因,它完全跳过了我的服务器任务。我最初认为服务器任务没有正确设置,但我可以删除watch任务,它将正确运行服务器任务与其他3,它只是不能一次运行所有5。


解决方案

因此,从文档中,只需声明任务的数量想。所以在你的情况下:

 选项:
logConcurrentOutput:true
limit:5

默认情况下,它只使用你的CPU有多少核心。



< blockquote>

limit



类型:数字默认值:CPU核心数量
(require('os')。cpus长度)至少为2



$ b

$ b

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


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?

解决方案

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

这篇关于Grunt Concurrent不能运行太多任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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