webpack-contrib / webpack-hot-middleware

Webpack hot reloading you can attach to your own server
MIT License
2.34k stars 296 forks source link

Unable to use dynamicPublicPath and specify port #281

Open slowselfip opened 6 years ago

slowselfip commented 6 years ago

Hello,

I have a use case where I need to use the dynamicPublicPath and have the ability to specify a custom port.

So, something like this: 'webpack-hot-middleware/client?dynamicPublicPath=true&path=__webpack_hmr&port=3000'

If my dynamic public path is set to /f9c5a3a910/, I'd like the client, with above entry point, to connect to: http://localhost:3000/f9c5a3a910/__webpack_hmr

glenjamin commented 6 years ago

The simplest way to do this right now would be to try and add the host and port into the dynamic public path in dev mode.

Otherwise I would accept a PR that made this possible, but i’m a bit wary about making the options any more complicated than they already are