Vite
How Gigadrive Network deploys a plain Vite project as static assets, and why the Vite preset is the last one tried.
Gigadrive Network detects Vite from vite in package.json and deploys the project as static
files, with no Function and no route table. The build output is published to the edge with no
configuration of your own.
What the preset configures
| Setting | Value |
|---|---|
| Function | None |
| Routes | None |
| Assets directory | dist |
| Environment | NODE_ENV=production |
The preset walks dist after the build and publishes every file it finds, so a zero-config
deployment already serves the site's HTML, scripts, styles and images. A prerendered page such as
dist/about/index.html also answers its extensionless route, /about, the way a static host
serves a directory.
Those files are uploaded to object storage and served by the CDN. Nothing is invoked, so a Vite site consumes no compute and is unaffected by concurrency limits. Static assets covers how they are matched and cached.
Why it is tried last
Vite is a dependency of SvelteKit, Nuxt and Astro projects, and of most projects that ship a server
alongside a bundled front end. The preset therefore sits at the bottom of the priority order and only
wins when nothing more specific matched. A project with both vite and express in its
dependencies is deployed as an Express application, not as a static site.
That ordering is also the thing to check when a Vite project deploys as static files but you expected a server. The framework recorded in the build log is the one that matched first.
Changing the output directory
If your vite.config sets build.outDir to something other than dist, name that directory in the
assets key instead. The rest of the preset is untouched, and Configuration
documents the remaining keys.
Vite documents its build options at vite.dev/guide/build.
