Help with errored bundles
After a chat with @gaearon today, we came up with a nicer way to handle invalid bundles.
When using the NoErrors plugin with hot middleware, we don't reload on broken builds - but a fresh request will serve up a stale bundle.
We can pull in dev-middleware to happen inside this middleware, and then conditionally send a different bundle when in an error state.
This will also simplify things slightly for consumers - they'll only need to include one middleware.
TBC: what dependency should be added to package.json? I think peerDependency on webpack-dev-middleware makes the most sense
Some wip at https://github.com/glenjamin/webpack-hot-middleware/tree/serve-valid-bundles
The basic idea is there, but I need a good way of identifying whether the file we're about to serve is a bundle - so we can tell when to replace it.