Skip to content

Commit 14d0b59

Browse files
author
Guillaume Chau
committed
fix(stylus): nested dependency watching
1 parent fc7975b commit 14d0b59

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/vue-stylus/vue-stylus.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ global.vue.lang.stylus = Meteor.wrapAsync(function ({
5050
if (!filePath) {
5151
return null
5252
}
53-
5453
dependencyManager.addDependency(filePath)
55-
5654
return [filePath]
5755
},
5856
readFile (filePath) {
@@ -70,18 +68,19 @@ global.vue.lang.stylus = Meteor.wrapAsync(function ({
7068
return sourcemap
7169
}
7270

73-
let style = stylus(source)
71+
let renderer = stylus(source)
7472
.use(nib())
7573
.set('filename', basePath)
7674
.set('sourcemap', { inline: false, comment: false })
7775
.set('cache', true)
7876
.set('importer', importer)
7977

80-
style.render((err, css) => {
78+
renderer.render((err, css) => {
8179
if (err) {
8280
cb(err, null)
8381
} else {
84-
const map = processSourcemap(style.sourcemap)
82+
renderer.deps(basePath).forEach(file => dependencyManager.addDependency(file))
83+
const map = processSourcemap(renderer.sourcemap)
8584
cb(null, {
8685
css,
8786
map,

0 commit comments

Comments
 (0)