我试图用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.
我不恰当地实施这个吗?
因此,从文档中,只需声明您想要的任务量.所以在你的情况下:
options: logConcurrentOutput: true limit: 5
默认情况下,它只使用CPU拥有的核心数量.
限制
类型:数字默认值:CPU核心数(require('os').cpus().length),最小值为2
同时运行的任务数量的限制.
https://github.com/sindresorhus/grunt-concurrent