Skip to content

Commit 605064b

Browse files
author
Spencer Elliott
committed
Add reportProgress function to afterEmit hook context
1 parent 8e6a012 commit 605064b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/ProgressPlugin.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,21 @@ class ProgressPlugin {
222222
handler(0.95, "emitting", tap.name);
223223
}
224224
});
225+
compiler.hooks.afterEmit.intercept({
226+
name: "ProgressPlugin",
227+
context: true,
228+
call: () => {
229+
handler(0.98, "after emitting");
230+
},
231+
tap: (context, tap) => {
232+
if (context) {
233+
context.reportProgress = (p, ...args) => {
234+
handler(0.98, "after emitting", tap.name, ...args);
235+
};
236+
}
237+
handler(0.98, "after emitting", tap.name);
238+
}
239+
});
225240
compiler.hooks.done.tap("ProgressPlugin", () => {
226241
handler(1, "");
227242
});

0 commit comments

Comments
 (0)