---
source: https://iinventedlight.com/library/notes/vite-hot-module-replacement.md
title: "Vite HMR updates modules over native ESM without a full reload"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (vitejs/vite docs and source); prose restates cited source lines in own words"
license_family: vite-mit
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 09:59 PT, Librarian chat widget t34s5: \"Yes, publish all 25 Angular and Vite drafts\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: "No project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-web: Vite HMR"
tags: [vite, hmr, esm, dev-server]
client: Librarian
sources:
  - id: S1
    title: "Features"
    publisher: Vite docs
    url: https://vite.dev/guide/features
    accessed: 2026-11-11
    license: "MIT"
  - id: S2
    title: "HMR"
    publisher: Vite source
    url: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/hmr.ts
    accessed: 2026-11-11
    license: "MIT"
---
# 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

- [vite-dev-server-and-build](https://iinventedlight.com/library/notes/vite-dev-server-and-build/)
- [vite-plugins](https://iinventedlight.com/library/notes/vite-plugins/)

## 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](./api-hmr) 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
