Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
add ability to use options.processor as a function
Browse files Browse the repository at this point in the history
  • Loading branch information
soul-wish committed Aug 7, 2016
1 parent a279c65 commit 10c5c57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ require('postcss-plugin')({option: value})
### Plugin options

#### options.processors
Type: `Array`
Type: `Array|Function`
Default value: `[]`

An array of PostCSS compatible post-processors.
An array of PostCSS compatible post-processors. You can also use a function that returns an array of PostCSS post-processors.

#### options.map
Type: `Boolean|Object`
Expand Down
6 changes: 5 additions & 1 deletion tasks/postcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ module.exports = function(grunt) {
issues: 0
};

processor = postcss(options.processors);
if (typeof options.processor === 'function') {
processor = postcss(options.processors.call());
} else {
processor = postcss(options.processors);
}

var done = this.async();

Expand Down

0 comments on commit 10c5c57

Please sign in to comment.