How to deploy a Vite application · Ample Computer

How to deploy a Vite application

Build and publish a Vite application as a static site, with support for common Vite frameworks and single-page app routing.

the short version

A Vite application is normally deployed from its production build output. Ample detects common Vite projects, installs dependencies, runs the build, verifies the static artifact, and serves it at a generated HTTPS URL. For a simple app, run ample deploy from the project directory.

Who this is for

This guide is for builders using Vite with React, Vue, Solid, or a plain JavaScript frontend.

How to do it

  1. Verify the Vite build. Run the package build script and confirm the output directory is created. The default is commonly dist, but the project config is the source of truth.

    $ npm run build
    
  2. Check public environment variables. Vite replaces VITE_ variables at build time. Only put values in that namespace if they are safe to expose to every browser user.

  3. Deploy the app. From a standalone Vite project, one deploy command is usually enough.

    $ ample deploy
    
  4. Test direct navigation. Open the home page and a nested client route. If the app is a single-page app, direct navigation should return the frontend entry point.

What this supports

Know the limits

Common failure modes