0

The GruntJs docs say that target level options should overwrite task level options.

I have built a plugin, grunt-esri-slurp, where I would like to have multiple targets (local dev and for travis ci). I have noticed that the task level options are not being overwritten by the target level options.

esri_slurp: {
  options: {
    version: '3.10',
    beautify: true
  },
  travis: {
    options: {
      beautify: false,
      version: '3.9'
    }
  }
}

when i run grunt esri_slurp:travis 3.10 is passed in as well as beautify. I used a yeoman generator to create the plugin and I don't know if I have to do something in the plugin itself to make this work. This would be the offending code I would imagine.

Is this a grunt bug or developer/user misunderstanding/error?

4

1 回答 1

1

您需要将呼叫更改为因为这是支持目标选项的呼叫。grunt.registerTaskgrunt.registerMultiTask

请务必阅读this.options文档

于 2014-07-31T00:16:14.397 回答