Skip to content

Commit 10a77fd

Browse files
committed
allow postcss options to be a function and close issue #106
1 parent 626d568 commit 10a77fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/style-rewriter.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ module.exports = function (css, map) {
3636
var query = loaderUtils.parseQuery(this.query)
3737
var options = this.options.vue || {}
3838
var autoprefixOptions = options.autoprefixer
39+
40+
// plugins
3941
var plugins = options.postcss
40-
? options.postcss.slice() // make sure to copy it
41-
: []
42+
if (typeof plugins === 'function') {
43+
plugins = plugins.call(this, this)
44+
}
45+
plugins = plugins ? plugins.slice() : [] // make sure to copy it
4246

4347
// scoped css
4448
if (query.scoped) {

0 commit comments

Comments
 (0)