Getting Started#
Use these guides to move from installation to production runtime without bouncing between framework pages, demos, and reference docs.
Start with the plugin, the bridge file, path configuration, and the assets CLI.
Keep HMR, proxy mode, direct mode, and manual dev-server workflows on one page.
Pick SPA, template, hybrid, or framework proxy mode based on how much frontend runtime you want.
Export OpenAPI, routes, and Inertia page props into frontend-friendly TypeScript outputs.
Build assets, publish them, and hand manifest-backed bundles back to Litestar cleanly.
Quick Start#
from litestar import Litestar
from litestar_vite import VitePlugin
app = Litestar(plugins=[VitePlugin()])
litestar assets init --template react-inertia
litestar assets install
litestar run --reload
VitePlugin() selects development or production behavior without application-side
VITE_DEV_MODE parsing. It also receives the effective host and port from either
the built-in Uvicorn litestar run command or the Granian replacement.
For optional Rust-native production static serving with Granian 0.16+, add
GranianPlugin(static="auto") without changing the Vite configuration:
from litestar import Litestar
from litestar_granian import GranianPlugin
from litestar_vite import VitePlugin
app = Litestar(
plugins=[
VitePlugin(),
GranianPlugin(static="auto"),
]
)
The Litestar static route remains available on every server. See Production and Deploy for eligibility, fallback behavior, and the server matrix.