grunt-contrib
Version:
A collection of common grunt tasks.
50 lines (34 loc) • 1.07 kB
Markdown
Several helpers are included as part of grunt-contrib, often to help improve consistency between tasks.
> Contributed By: [Tyler Kellen](/tkellen) (@tkellen)
This helper will retrieve an options object from the global options.task key. If a subtask has been defined, data in options.task.subtask can override keys in options.task. Finally, an options object defined directly in the task key will override all.
This parameter is used to find out the current task, commonly passed ```this``` from within tasks.
This parameter allows developers to define sensible default options that are set if user neglected to set them.
```javascript
var options = grunt.helper("options", this, {fallback: true}); // loads options for current task
```
```javascript
options: {
task: {
param: 'default',
subtask: {
param: 'override default'
}
}
},
task: {
subtask: {
options: {
param: 'override all'
}
}
}
```