Vite provides a Hot Module Replacement API over native ESM
Answer: At a basic level, developing with Vite is not that different from using a static file server. Vite then adds enhancements over native ESM imports that you usually see in bundler-based setups.
One of those enhancements is Hot Module Replacement. Vite provides an HMR API over native ESM. Frameworks with HMR can use that API to apply precise updates without reloading the page or dropping application state. Vite ships first-party HMR integrations for Vue Single File Components and React Fast Refresh. There is also an official Preact integration.
Vite also rewrites bare module imports to valid URLs the browser can load, and it pre-bundles dependencies to speed up page load and to convert CommonJS or UMD modules to ESM.
In source
handleHMRUpdate is the server function that handles create, delete, and update events for a file on a ViteDevServer.
See also
Claims
- id: C1 claim: Vite adds enhancements over native ESM imports. source: S1 evidence: "Vite provides many enhancements over native ESM imports to support various features"
- id: C2 claim: Vite provides an HMR API over native ESM. source: S1 evidence: "Vite provides an HMR API over native ESM."
- id: C3 claim: Frameworks can apply precise updates without reloading the page. source: S1 evidence: "provide instant, precise updates without reloading the page or blowing away application state."
- id: C4 claim: handleHMRUpdate processes create, delete, and update events. source: S2 evidence: "export async function handleHMRUpdate("
Sources
- [S1] Features. Vite docs. https://vite.dev/guide/features . License: MIT. Accessed 2026-11-11.
- [S2] HMR. Vite source. https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/hmr.ts . License: MIT. Accessed 2026-11-11.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Vite documentation and source (vitejs/vite): Copyright (c) 2019-present, VoidZero Inc. and Vite contributors; MIT (https://raw.githubusercontent.com/vitejs/vite/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Vite docs and Vite source (vitejs/vite), MIT. Notices: Vite documentation and source (vitejs/vite): Copyright (c) 2019-present, VoidZero Inc. and Vite contributors; MIT (https://raw.githubusercontent.com/vitejs/vite/main/LICENSE).
Cite this
iinventedlight. 2026. "Vite HMR updates modules over native ESM without a full reload." iinventedlight Library, iil:note:qr958d39, version of 2026-11-11. https://iinventedlight.com/library/notes/vite-hot-module-replacement/. License: CC-BY-4.0.
@misc{iil_note_qr958d39,
author = {{iinventedlight}},
title = {{Vite HMR updates modules over native ESM without a full reload}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-11},
url = {https://iinventedlight.com/library/notes/vite-hot-module-replacement/},
note = {Permanent ID iil:note:qr958d39. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/vite-hot-module-replacement.md.