---
source: https://iinventedlight.com/library/notes/vite-native-esm.md
title: "Vite serves source over native ESM and pre-bundles dependencies"
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 native ESM"
tags: [vite, esm, dependencies, dev-server]
client: Librarian
sources:
  - id: S1
    title: "Why Vite"
    publisher: Vite docs
    url: https://vite.dev/guide/why
    accessed: 2026-11-11
    license: "MIT"
  - id: S2
    title: "import analysis plugin"
    publisher: Vite source
    url: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/importAnalysis.ts
    accessed: 2026-11-11
    license: "MIT"
---
# Vite split dev work into pre-bundled dependencies and on-demand source

**Answer:** Vite was created because large projects were seeing slow dev server startups, sluggish hot updates, and long production builds. Rather than only improving existing bundlers, it changed how code is served during development.

When Vite first appeared, browsers had gained wide support for ES modules (ESM), which can load JavaScript files directly without bundling them first. Traditional bundlers processed the entire application before anything could be shown. Vite split the work in two. Dependencies, which rarely change, are pre-bundled once with fast native tooling. Source code, which changes often, is served on demand over native ESM. The browser loads only what the current page needs.

## In source

A dev-only plugin lexes, resolves, rewrites, and analyzes URL imports. Imports are resolved so they exist on disk. Bare module imports are resolved to absolute file paths. For example, `import 'foo'` is rewritten to a `/@fs/` path under `node_modules`.

## See also

- [vite-dep-pre-bundling](https://iinventedlight.com/library/notes/vite-dep-pre-bundling/)
- [vite-dev-server-and-build](https://iinventedlight.com/library/notes/vite-dev-server-and-build/)

## Claims

- id: C1
  claim: Vite changed how code is served during development.
  source: S1
  evidence: "it rethought how code should be served during development."

- id: C2
  claim: Dependencies are pre-bundled once with fast native tooling.
  source: S1
  evidence: "are [pre-bundled](./dep-pre-bundling.md) once using fast native tooling, so they're ready instantly."

- id: C3
  claim: Source code is served on demand over native ESM.
  source: S1
  evidence: "is served on-demand over native ESM."

- id: C4
  claim: A dev-only plugin lexes, resolves, rewrites and analyzes URL imports.
  source: S2
  evidence: "Dev-only plugin that lexes, resolves, rewrites and analyzes url imports."

## Sources

- [S1] Why Vite. Vite docs. https://vite.dev/guide/why . License: MIT. Accessed 2026-11-11.

- [S2] import analysis plugin. Vite source. https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/importAnalysis.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).
