Running a grunt task on one Gruntfile from another

后端 未结 4 1142
予麋鹿
予麋鹿 2020-12-24 02:18

I have a Gruntfile in the root of my project. I also have jQuery installed via Bower in an app/components/jquery directory.

As part of my Gruntfile I\'d like to run

4条回答
  •  孤独总比滥情好
    2020-12-24 03:06

    You can create a simple task that spawns grunt in the folder you want:

    grunt.registerTask('run-grunt', function () {
        var done = this.async();
        grunt.util.spawn({
            grunt: true,
            args: [''],
            opts: {
                cwd: 'app/components/jquery'
            }
        }, function (err, result, code) {
            done();
        });
    });
    

提交回复
热议问题