百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

grunt-concurrent

> 编程语言
开源

同时运行 grunt 任务

791 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

同时运行 grunt 任务

grunt-concurrent\n\n> 并行运行 grunt 任务\n\n运行像 Coffee 和 Sass 这样的慢速任务并行可以大大提高构建时间。如果需要同时运行 多个阻塞任务 如 nodemon 和 watch,此任务也很有用。\n\n## 安装\n```sh

npm install --save-dev grunt-concurrent \n\n## 使用\njs require('load-grunt-tasks')(grunt);

grunt.initConfig({ concurrent: { target1: ['coffee', 'sass'], target2: ['jshint', 'mocha'] } });

// Tasks of target1 run concurrently, after they all finished, tasks of target2 run concurrently, instead of target1 and target2 running concurrently. grunt.registerTask('default', ['concurrent:target1', 'concurrent:target2']); \n\n## 并行目标中的顺序任务\njs grunt.initConfig({ concurrent: { target: [['jshint', 'coffee'], 'sass'] } }); ```\n\n现在 jshint 将始终在 coffee 和 sass 运行之前完成,无论它们是否独立运行。\n\n## 选项\n\n### limit\n类型: number\n默认值: CPU 核心数的两倍,最小值为 2\n\n限制同时运行的任务数量。\n\n### logConcurrentOutput\n类型: boolean\n默认值: false\n\n记录并行运行的输出。

您可以通过指定 logConcurrentOutput 选项可选地记录并发任务的输出。以下是一个配置示例,它使用 grunt-nodemon 启动和监控一个 Node 服务器,并使用 grunt-contrib-watch 在一个终端标签中监控资源变化:

您可以通过指定 false 来选择性地跳过并发任务的日志输出缩进。这对于在标准输出解析器中并行运行任务时很有用。

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言