Skip to content

Commit 7529218

Browse files
committed
support deps registered by postcss plugins
1 parent 595d502 commit 7529218

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/style-compiler/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,20 @@ module.exports = function (css, map) {
5555

5656
return postcss(plugins)
5757
.process(css, options)
58-
.then(function (result) {
58+
.then(result => {
59+
if (result.messages) {
60+
result.messages.forEach(m => {
61+
if (m.type === 'dependency') {
62+
this.addDependency(m.file)
63+
}
64+
})
65+
}
5966
var map = result.map && result.map.toJSON()
6067
cb(null, result.css, map)
6168
return null // silence bluebird warning
6269
})
6370
}).catch(e => {
64-
console.log(e)
71+
console.error(e)
6572
cb(e)
6673
})
6774
}

0 commit comments

Comments
 (0)