diff --git a/README.md b/README.md index 1ad205f..8872a30 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,28 @@ Example use of the `override` option: }); ``` +#### options[task] + * type: `object` + +This allows overriding options on a per task level. + +Example: + +```js + grunt.initConfig({ + newer: { + options: { + less: { + override: function(detail, include) { + //no longer need to check the task name + checkForModifiedImports(detail.path, detail.time, include); + } + } + } + } + }); +``` + ## That's it Please [submit an issue](https://github.com/tschaub/grunt-newer/issues) if you encounter any trouble. Contributions or suggestions for improvements welcome! diff --git a/changelog.md b/changelog.md index 51fd822..aa28786 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Change Log +## 1.2.0 + + * Add newer options on a per task basis + ## 1.1.0 * Write current time to timestamp file (thanks @malys, see [#69][69]) diff --git a/package.json b/package.json index 5a5dec8..5652a9b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grunt-newer", "description": "Run Grunt tasks with only those source files modified since the last successful run.", - "version": "1.1.1", + "version": "1.2.0", "homepage": "https://github.com/tschaub/grunt-newer", "author": { "name": "Tim Schaub", diff --git a/tasks/newer.js b/tasks/newer.js index 14bb0ee..50ea7f6 100644 --- a/tasks/newer.js +++ b/tasks/newer.js @@ -50,6 +50,11 @@ function createTask(grunt) { override: nullOverride }); + if(options[taskName]) { + options = grunt.util._.extend(options, options[taskName]); + delete options[taskName]; + } + // support deprecated timestamps option if (options.timestamps) { grunt.log.warn('DEPRECATED OPTION. Use the "cache" option instead');