运行跨多个grunt.js文件configuration的任务

我有一个包含多个未发布模块的节点应用程序。 我的应用程序的package.json包含一些git依赖项:

 "module-a": "git+ssh://git@github.com:me/module-a.git", "module-b": "git+ssh://git@github.com:me/module-b.git" 

每个人都有自己的gruntconfiguration。 例如在node_modules/module-a/grunt.js

 module.exports = function(grunt) { grunt.initConfig({ lint: { files: ['server/**/*.js', 'test/**/*.js'] }, jshint: { options: require('./lint-ci') } }); grunt.registerTask('default', 'lint'); 

};

(他们也运行testing等,但我在这里保持简单)

有没有一个内置的方式来做到这一点与咕噜? 请注意,为了方便起见,我只想保留相关的grunt.js文件,只是在该依赖项中更改了某些内容。

我find的唯一解决scheme是

  • 以编程方式构build我的主要grunt.js(例如,遍历我的package.json中的依赖项来构buildlint和testingconfiguration)
  • 使用--config node_modules/module-a/grunt.js多次调用grunt

两者都不是理想的。 有没有更好的办法?

只是一个想法,但你有没有看过grunt-hub?

https://github.com/shama/grunt-hub