You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
When optimization.runtimeChunk is single 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.
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.
Also HMR doesn't work without allEntries: true; not sure if it's normal.
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 runtimeChunk: 'single' with "webpack-serve" the window.webpackHotUpdate is set multiple times in each entry point which infers that handler code is being duplicated. With "wepback-dev-server", this code only appears in the runtime chunk -- which I think is probably the desired behaviour.
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: