-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve webpack-hot-middleware conflicts #49
Conversation
CC @blainekasten would be great if you can provide some insights on this. I will take a look at the WHM docs tomorrow. |
In short, via
the WHM client If they have different |
@pmmmwh we face the same issue in our cli. we use a seperate server with webpack-hot-middlware and we also see that behaviour. Would be cool if you could merge that #soon. |
Hi! I have taken a look at this and I think a better way to handle this would be to:
(I'm assuming that requiring the client with the same path will not execute Update: |
😮 I guess Only use the WHM |
There is handling for the |
Yes, I am experimenting with dynamic import or just scrap the idea of injecting the |
Since #64 has been merged I'll close this for now. |
When I use webpack-hot-middleware with a custom
path
:server.js
webpack.config.js
The client will send two HMR requests:
The
require('webpack-hot-middleware/client')
in WHMEventSource.js will create a newEventSourceWrapper
, and thepath
(from query) is the key ofEventSourceWrapper
in webpack-hot-middleware:https://github.com/webpack-contrib/webpack-hot-middleware/blob/cb29abb9dde435a1ac8e9b19f82d7d36b1093198/client.js#L119
So inject user's
webpack-hot-middleware/client
entry beforeErrorOverlayEntry
, and try to customize overlay on the existing client.https://github.com/webpack-contrib/webpack-hot-middleware/blob/cb29abb9dde435a1ac8e9b19f82d7d36b1093198/client.js#L302
https://github.com/webpack-contrib/webpack-hot-middleware/blob/cb29abb9dde435a1ac8e9b19f82d7d36b1093198/client.js#L152