-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does browser swap in the new module? #24
Comments
It uses module versioning and dynamic imports to "reload" modules without deleting the module cache. The loaded content is then passed to Also, commenting this for my own future reference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey guys, does anyone understand how ES Module's HMR works under-the-hood (for example in Vite or React Fast Refresh)? i.e. How is it able to swap out a modified module at runtime?
Usually, every time you change a module, browser will refetch that module via HTTP.
But after that, how does the browser replace the old module, and have the new code take into effect?
The only thing I found is https://itnext.io/hot-reloading-native-es2015-modules-dc54cd8cca01, is this the solution we're taking?
The text was updated successfully, but these errors were encountered: