Grunt Concurrent无法运行太多任务

 手机用户2502932937 发布于 2023-02-07 11:39

我试图用grunt运行多个监视任务,但似乎无法做到.我正在使用grunt并发,但它似乎只运行我指定的一部分任务,只是停止.

这是我的gruntfile的片段:

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

当我运行它时,输出显示:

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...

出于某种原因,它正在完全跳过我的服务器任务.我最初认为服务器任务没有正确设置,但我可以删除一个监视任务,它将正确运行服务器任务和其他3,它只是不能一次运行所有5.

我不恰当地实施这个吗?

1 个回答
  • 因此,从文档中,只需声明您想要的任务量.所以在你的情况下:

    options:
          logConcurrentOutput: true
          limit: 5
    

    默认情况下,它只使用CPU拥有的核心数量.

    限制

    类型:数字默认值:CPU核心数(require('os').cpus().length),最小值为2

    同时运行的任务数量的限制.

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

    2023-02-07 11:41 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有