webpack-hot-middleware
webpack-hot-middleware copied to clipboard
Fix possible double slashs when dynamicPublicPath
This PR contains a:
- [x] bugfix
- [ ] new feature
- [ ] code refactor
- [ ] test update
- [ ] typo fix
- [ ] metadata update
Motivation / Use-Case
Hi, Thanks for this package!
I'm in a situation where a tool I can't control set my publicPath from config, and add a / to it. In fact webpack recommends to do that:
The value of the option is prefixed to every URL created by the runtime or loaders. Because of this the value of this option ends with / in most cases.
However the HMR path also starts with a /, and all the default paths and example of this package!
With theses both slashes, when in case of dynamicPublicPath: true, we end to a publicPath//path path.
This little PR just fixes that by replacing all // with / in the paths concatenation.
Thanks, Mathieu.
Circle fails for a reason which seems not related to this PR.
@mathieutu Sorry for delay, can you add test case?
Sorry, but it has been more than two years, and I'm not using the project anymore.
I'll try to take a look, but if someone wants to tackle it, feel free!