Programmatically set options for grunt task?

前端 未结 6 1294
旧时难觅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条回答
  •  猫巷女王i
    2021-02-07 08:35

    grunt is all programmatic.. so if you have set options on tasks before, you have done this programmatically.

    just use grunt.initConfig({ ... }) to set options for tasks.

    and if you already initialized, and need to change configuration afterwards, you can do something like

    grunt.config.data.my_plugin.goal.options = {};

    I am using it for my project and it works.

提交回复
热议问题