-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
feat(hmr): call hotUpdate hook with file create/delete
#16249
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
feat(hmr): call hotUpdate hook with file create/delete
#16249
Conversation
|
|
|
This is great! I needed to modify |
It seems they want I'll make a new PR without the last commit (1bbaa6f) and cherry-pick the last commit on top of |
1bbaa6f to
f1ecdb4
Compare
hotUpdate hook with file create/delete
hotUpdate hook with file create/deletehotUpdate hook with file create/delete
|
The test failure is same with #16129 |
patak-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for rebasing the PR!
Description
The import.meta.glob plugin was using
server._importGlobMap. If thehandleHotUpdatehook runs on file create/delete, that variable can be moved inside the plugin by using that hook.This PR is mostly a refactor but it changes two behaviors.
/foo.htmlandfoo.htmlis created or deleted, a reload will happen)_runHandleHotUpdateOnCreateAndDelete: true,handleHMRUpdatehook will be called forcreate/deleteevents.HmrContexttype now hastype: 'create' | 'delete' | 'update'. I added the new property to keep backward compatibility, but maybe we can just call it for all plugins.Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).