Can I have multiple gruntjs files in my project for code organization?

前端 未结 3 634
小蘑菇
小蘑菇 2020-12-14 04:08

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 l

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 04:38

    There's a grunt task called grunt-hub which seems to do what you want to do.

    grunt-hub:

    A Grunt task to watch and run tasks on multiple Grunt projects.

    hub task

    The hub task is for running tasks on multiple projects. It would like to know which Gruntfiles to use and which tasks to run on each Grunt project. For example if I would like to lint and test on every Grunt project one folder up:

    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.

提交回复
热议问题