I’m using gruntjs for my project and was wondering if it’s possible to have multiple grunt.js files in my project? The reason I’m asking is that my project is organized like so:
grunt.js
|
|- project1
| |
| |-grunt.js
|
|- project2
|
|- project3 (etc..)
I want the top level grunt.js to build all the projects. However as the list of projects grow I don’t want my top level grunt.js file to become huge. So I would like to organize it so that the top level grunt can call the project level grunt files to build them. Or if someone wants to just build project1, they can go to the project1 folder and run it’s own grunt.js. Can this be done? If so, how do I call the other grunt files? If not, then what’s an alternative solution other than having one huge grunt.js file? Thanks.
There’s a grunt task called grunt-hub which seems to do what you want to do.
I haven’t used it, but it might meet your requirements. Also you might want to look into more lower level such as grunt-exec or creating your own tasks to spawn child processes.