Programmatically set options for grunt task?

前端 未结 6 1196
旧时难觅i
旧时难觅i 2021-02-07 07:52

I have a grunt task that looks at options with grunt.option(\'foo\'). If I\'m calling this task from grunt.task.run(\'my-task\'), how can I change thos

6条回答
  •  野性不改
    2021-02-07 08:38

    Looks like I can use the following:

    grunt.option('foo', 'bar');
    grunt.task.run('my-task');
    

    It feels a bit odd to set the options globally instead of just for that command, but it works.

提交回复
热议问题