Skip to content

Commit 3cb0f30

Browse files
committed
Merge branch 'master' of github.com:vuejs/vue-loader
2 parents c2b4bc1 + 9416ae9 commit 3cb0f30

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
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) {

test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('vue-loader', function () {
3434

3535
function getFile (file, cb) {
3636
fs.readFile(path.resolve(outputDir, file), 'utf-8', function (err, data) {
37-
expect(err).to.be.null
37+
expect(err).to.be.not.exist
3838
cb(data)
3939
})
4040
}

0 commit comments

Comments
 (0)