Currently, I have a task that integrating Webpack HRM into Single Spa application. So I have researched some articles about Webpack HRM and React Hot Loader or React Fast Refresh. I also read some articles that using module.hot.accept
to receive new updates.
But there are a few things that I still wonder:
- Does React Hot Loader/ React Fast Refresh plugins automatically add
module.hot.accept
in my source code in development? - How SystemJS handle new update received from Webpack Dev Server? (used Chrome Debug Tool to inspect socket connection and http connection - I see there is exchange between browser (HMR Runtime in my source code) and Webpack Dev Server but nothing happens until I proactively reload the page).
- How can I implement HMR in my source code without React Hot Loader or React Refresh plugins? (Just with
module.hot.accept
)
Does anybody know deeply about Webpack HMR? Please help me understand this. Thank you in advance
P/s: I know my English is not good and my questions are wide. Please correct me if you understand my idea. Thank a lot.