ViVite · Lesson 4 of 6
Plugins & HMR
Vite's plugin API is based on Rollup's, extended with Vite-specific hooks. Most frameworks have an official Vite plugin. HMR (Hot Module Replacement) updates the browser in milliseconds without a full page reload.
◆ Note
Vite's HMR works out of the box for Vue and React (via their plugins). For vanilla JS, you need to handle `import.meta.hot` manually. HMR preserves component state during updates — you edit a button's style and the button updates instantly without losing what you typed in a nearby form.
Vite's HMR works out of the box for Vue and React (via their plugins). For vanilla JS, you need to handle `import.meta.hot` manually. HMR preserves component state during updates — you edit a button's style and the button updates instantly without losing what you typed in a nearby form.