Performing tasks configured in multiple grunt.js files

I have a node application that includes several unpublished modules. My package.json application includes several git dependencies:

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

and each one has its own grunt configuration. For example, in 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'); 

};

(they also run tests, etc., but I save it just here)

Is there a built-in way to do this with grunt? Note that I want to save the grunt.js dependent files for convenience, when I just changed something in this dependency.

The only solutions found are

  • create my main grunt.js programmatically (for example, iterating over my dependencies in package.json to create a lint and test configuration)
  • calling grunt several times with --config node_modules/module-a/grunt.js

Doesn't seem perfect. Is there a better way?

+8
javascript gruntjs
source share
1 answer

Just a thought, but did you look at grunts?

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

+3
source share

All Articles