Skip to content

Commit e46b8e6

Browse files
authored
Merge pull request #199 from StratusFearMe21/parcel_messages
2 parents affa36a + 23942a8 commit e46b8e6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports = (options = {}) => tree => {
147147
return processStacks(
148148
processPushes(
149149
processTree(options)(
150-
expressions(options.expressions)(tree)
150+
expressions(options.expressions)(tree), tree.messages
151151
),
152152
pushedContent,
153153
options.push
@@ -168,7 +168,7 @@ let processCounter = 0;
168168
function processTree(options) {
169169
const filledSlots = {};
170170

171-
return tree => {
171+
return (tree, messages) => {
172172
log(`Processing tree number ${processCounter}..`, 'processTree');
173173

174174
if (options.plugins.length > 0) {
@@ -184,6 +184,13 @@ function processTree(options) {
184184

185185
const componentPath = getComponentPath(currentNode, options);
186186

187+
if (messages) {
188+
messages.push({
189+
type: 'dependency',
190+
file: componentPath
191+
});
192+
}
193+
187194
if (!componentPath) {
188195
return currentNode;
189196
}
@@ -222,7 +229,7 @@ function processTree(options) {
222229
return currentNode.content || nextNode.content;
223230
});
224231

225-
nextNode = processTree(options)(nextNode);
232+
nextNode = processTree(options)(nextNode, messages);
226233

227234
// Process <fill> tags
228235
processFillContent(nextNode, filledSlots, options);

0 commit comments

Comments
 (0)