-
Notifications
You must be signed in to change notification settings - Fork 50
Duplicated “single” runtime #88
Comments
I don't know much about the optimization settings or what they're supposed to do, what their side-effects are, and I don't have the time to learn about that at the moment. Happy to review a PR that resolves this.
One actual issue per issue please. We haven't seen an issue with that, so it's probably due to the way your config is setup. |
I think I am seeing this same thing. After much head-banging I can confirm there's definitely some difference in behaviour between "wepback-dev-server" and "webpack-serve". When using This seems to break HMR in some scenarios. I noticed the HMR of packages like https://github.com/shepherdwind/css-hot-loader and https://github.com/faceyspacey/extract-css-chunks-webpack-plugin seems to not work as the hot accept function never gets called. I think that might be because the hot client runtime being in every chunk is fundamentally incompatible when you have a separate runtime chunk. I don't know enough about Webpack do dig deeper at this point. |
Maybe @sokra could help? How could the client be injected in runtime chunks only? Current strategy seems to add it to every entry. |
In the meantime I disabled |
Expected Behavior
When
optimization.runtimeChunk
issingle
the client script should be injected in the runtime only.Actual Behavior
The client script is injected in the runtime then the runtime is injected in the entrypoint. Also HMR doesn't work without
allEntries: true
; not sure if it's normal.EDIT: it's normal I just didn't understand I needed it in my case.
Code
webpack.config.js
https://gist.github.com/MatTheCat/2e11f1ddbdf8bee2663fa2a5d2a227a2
serve.config.js
How Do We Reproduce?
Enable webpack-hot-client with
optimization.runtimeChunk = 'single'
.The text was updated successfully, but these errors were encountered: