feat(hmr): call hotUpdate hook with file create/delete#16249
feat(hmr): call hotUpdate hook with file create/delete#16249patak-cat merged 3 commits intovitejs:feat/environment-apifrom
hotUpdate hook with file create/delete#16249Conversation
|
|
|
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-cat
left a comment
There was a problem hiding this comment.
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).