Vite
Source:
src/Hetzner/Website/Vite.ts
Deploy a plain Vite application to a Hetzner Cloud
Server: vite build output served by a static-file systemd unit on
port 3000. For client-only projects — React/Vue/Solid SPAs,
index.html multi-page apps — whose entire deployable output is
static assets.
The build runs through @alchemy.run/frontend-frameworks/vite with the
@alchemy.run/frontend-frameworks/vite/node deploy target — the package
must be installed in your project. During alchemy dev the site is
Vite’s own dev server and no cloud resources are created.
Creating Vite Sites
Section titled “Creating Vite Sites”Basic Vite SPA
const site = yield* Hetzner.Website.Vite("Web");Project in a Subdirectory
const site = yield* Hetzner.Website.Vite("Web", { rootDir: "./app",});Existing Server
const server = yield* Hetzner.Server("box", { serverType: "cpx12", image: "ubuntu-24.04", location: "fsn1",});const site = yield* Hetzner.Website.Vite("Web", { server });Multi-Page Sites
Section titled “Multi-Page Sites”const site = yield* Hetzner.Website.Vite("Docs", { assets: { notFoundHandling: "404-page" },});Custom Domain
Section titled “Custom Domain”const site = yield* Hetzner.Website.Vite("Web", { domain: "app.example.com", zone,});Build Configuration
Section titled “Build Configuration”const site = yield* Hetzner.Website.Vite("Docs", { outDir: "build", base: "/docs/",});Local Development
Section titled “Local Development”// `alchemy dev` starts `vite` programmatically: site.url is the local// dev server (HMR included); no Server or Service is created.const site = yield* Hetzner.Website.Vite("Web");