Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ app.use(webpackMiddleware(webpack({
// switch into lazy mode
// that means no watching, but recompilation on every request

onUpdate: function(stats) { doWhateverWithStats(stats); },
// manually handle the stats from the last compilation
// can be combined with quiet and noInfo for full control over output

watchOptions: {
aggregateTimeout: 300,
poll: true
Expand Down
4 changes: 4 additions & 0 deletions middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ module.exports = function(compiler, options) {
process.nextTick(function() {
// check if still in valid state
if(!state) return;

// make a callback with stats
if(typeof options.onUpdate === 'function') options.onUpdate(stats);

// print webpack output
var displayStats = (!options.quiet && options.stats !== false);
if(displayStats &&
Expand Down