Skip to content

Commit 90a1c98

Browse files
committedAug 27, 2020
allow nested watchers in plan
1 parent 8014a39 commit 90a1c98

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
 

‎lib/reducePlan.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ module.exports = (plan, limit) => {
110110
}
111111
// Write down new plan
112112
const newPlan = new Map();
113-
for (const node of treeMap.values()) {
114-
if (!node.active) continue;
113+
for (const rootNode of treeMap.values()) {
114+
if (!rootNode.active) continue;
115115
const map = new Map();
116-
const queue = new Set([node]);
116+
const queue = new Set([rootNode]);
117117
for (const node of queue) {
118+
if (node.active && node !== rootNode) continue;
118119
if (node.value) {
119120
if (Array.isArray(node.value)) {
120121
for (const item of node.value) {
@@ -125,10 +126,12 @@ module.exports = (plan, limit) => {
125126
}
126127
}
127128
if (node.children) {
128-
for (const child of node.children) queue.add(child);
129+
for (const child of node.children) {
130+
queue.add(child);
131+
}
129132
}
130133
}
131-
newPlan.set(node.filePath, map);
134+
newPlan.set(rootNode.filePath, map);
132135
}
133136
return newPlan;
134137
};

0 commit comments

Comments
 (0)
Please sign in to comment.