Skip to content

Commit 2486670

Browse files
committed
feat(onUpdate): accept a callback as options.onUpdate
If options.onUpdate is provided, it will be called with the stats results of the compilation on every build. In combination with setting options.quiet, it allows the user to manually handle the logging of the stats.
1 parent a9fc7f4 commit 2486670

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

middleware.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ module.exports = function(compiler, options) {
4040
process.nextTick(function() {
4141
// check if still in valid state
4242
if(!state) return;
43+
44+
// make a callback with stats
45+
if(typeof options.onUpdate === 'function') options.onUpdate(stats);
46+
4347
// print webpack output
4448
var displayStats = (!options.quiet && options.stats !== false);
4549
if(displayStats &&

0 commit comments

Comments
 (0)