Skip to main content
Aero is configured through the aero() Vite plugin. For larger projects, you can move Aero options into a dedicated aero.config.ts.

The Vite plugin

Add aero() to vite.config.ts:
vite.config.ts

Plugin options

vite.config.ts

Dedicated aero.config.ts

For projects with more complex configuration, use @aero-js/core/config to keep Aero options separate from Vite:
aero.config.ts
vite.config.ts
createViteConfig() with no arguments auto-loads aero.config.ts from the project root.

Env-aware config

Pass a function to defineConfig() to vary options by mode:
aero.config.ts

Path aliases

Aero injects default path aliases so imports work without tsconfig.json configuration:
Add custom aliases in tsconfig.json under compilerOptions.paths. They merge with the defaults.

Environment variables

Aero uses Vite’s environment variable system. Variables in .env files are available in build scripts by default. Prefix with VITE_ to expose them to client scripts:
.env
Vite loads .env, .env.local, .env.[mode], and .env.[mode].local in order. Shell variables override file values.

Reactivity and hypermedia

Optional client features behind feature flags (both default false): busy and post-swap binding processing require both flags. See Reactivity and Hypermedia to enable and use them. HTMX and Alpine.js work without these flags.