I am currently using the basic Webpack API with a custom printer for the build results, i.e.:
import webpack from 'webpack'
webpack({ /* webpack config */ }, printStats)
function printStats(err, stats) {
// my custom printing of build results
}
Now I want to switch to using webpack-dev-middleware
, but retain my stat printer. I would expect maybe this to work:
import webpackDev from 'webpack-dev-middleware'
app.use(webpackDev(webpack({ /* webpack config */ }, printStats), {
quiet: true // disable default printing so I can use my own
// ... more webpack-dev-middelware configuration
}))
but it only prints the first compilation and ignores subsequent ones even though they do take place. What is the right way to do this?