Antler by Autoflux

API Reference

The core exports, config keys, and plugin hooks developers reach for most.

Path: api-reference

Third-party documentation. This is independently authored analysis of the public Vite codebase — not the official docs, and not reviewed or endorsed by the Vite team.

API Reference

The core runtime APIs, CLI commands, config keys, and plugin hooks that developers reach for most. This is a curated map of the public surface — for exhaustive detail, see the official documentation.

Runtime APIs

  • import.meta.envMODE, BASE_URL, PROD, DEV, SSR, and every VITE_-prefixed variable.
  • import.meta.hot — the HMR client: accept, dispose, invalidate, send/on.
  • import.meta.glob — import a set of modules statically or lazily from a glob pattern.
  • import.meta.url — the current module's URL.

CLI

  • vite (aliases dev, serve) — start the dev server.
  • vite build — production build into dist/.
  • vite preview — serve the production build locally.
  • vite optimize — manually pre-bundle dependencies.

Key config keys

plugins, resolve.alias/resolve.extensions, server.host/port/proxy/fs.allow, build.outDir/target/sourcemap/rollupOptions.output.manualChunks, envPrefix, optimizeDeps.include/exclude, publicDir, and base.

Plugin hooks

Vite inherits Rollup's resolveId, load, transform, buildStart, and output hooks, and adds dev-only hooks: config/configResolved (mutate config), configureServer (dev middleware), transformIndexHtml (rewrite index.html), and handleHotUpdate (customize HMR).

Common packages

@vitejs/plugin-react (React Fast Refresh), @vitejs/plugin-vue (Vue SFC compilation and HMR), @vitejs/plugin-legacy (legacy browser support via SystemJS), and create-vite (scaffolding templates).

Interface

Interface
text
# Runtime APIs
import.meta.env { MODE, BASE_URL, PROD, DEV, SSR, VITE_* }
import.meta.hot HMR client (accept, dispose, invalidate, send/on)
import.meta.glob import many modules statically or lazily
import.meta.url current module URL
 
# CLI
vite start dev server (aliases: dev, serve)
vite build production build
vite preview preview the production build
vite optimize pre-bundle dependencies manually
 
# Config (vite.config.ts, defineConfig)
plugins, resolve.alias, resolve.extensions
server.host, server.port, server.proxy, server.fs.allow
build.outDir, build.target, build.sourcemap,
build.rollupOptions.output.manualChunks
envPrefix, optimizeDeps.include/exclude, publicDir, base
 
# Plugin API (extends Rollup hooks)
config / configResolved mutate config
configureServer dev-server middleware
transformIndexHtml modify index.html
resolveId / load / transform per-module pipeline (dev + build)
handleHotUpdate customize HMR
closeBundle run after build finishes
 
# Common plugins / packages
@vitejs/plugin-react React Fast Refresh
@vitejs/plugin-vue Vue SFC compiler + HMR
@vitejs/plugin-legacy legacy browser builds
create-vite scaffolding templates
 
STATUSinterface