-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Implementation in HMR event, 'vite:afterUpdate' #6379
Comments
I think this make sense, but it would be helpful if you can show a usecase for it too to further justify this feature request. |
@bluwy Thanks for reply. Should I refer ordinary usecase, using other bundlers, such as webpack, rollup? (usecase for |
For me would be useful to update styles after update, because my app has multiple iframes and I have to keep styles in sync between them manually. |
I was looking for something like this, this will be specially useful for the work I'm doing with ThreeJS, since is tricky to have a good DX while updating files, with this hooks I could basically dispose renderers and initialize them |
@alvarosabu see #9810, it will be available in Vite 4 (the first alpha is going to be out next week, so you could start using it if you need it before the stable release) |
Clear and concise description of the problem
The problem is that I cannot precisely
handle HMR events
, specifically 'after update'.According to rollup.js, there is feature like below:
and other bundlers have similar features, such as
wepack.addStatus('idle', () => { //... })
.Suggested solution
Abstract implementation is somehow like below:
Add
notifyListeners('vite:afterUpdate')
afterpayload.updates.forEach
loop ends.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: