Open empeje opened 5 years ago
Hello @empeje!
The plugin exposes the underlying webpack-dev-middleware
using Hapi's server.expose()
API. This means, you can access it through server.plugins.WebpackDevServerPlugin.devMiddleware
.
For example:
hapiServer.ext('onRequest', (request, h) => {
const devMiddleware = hapiServer.plugins.WebpackDevServerPlugin.devMiddleware;
devMiddleware.waitUntilValid((stats) => {
// Do something with stats here...
});
return h.continue;
});
I'm following https://github.com/webpack/webpack-dev-middleware#server-side-rendering for SSR options of webpack-dev-middleware, but I can't get the stats object from the plugin. I also new to hapi, so I don't know how to access it.