BlogVite and React

How to deploy a Vite React app.

A Vite app is a static site on Antideploy: it builds to a folder of files, and the files are served for free.

How the Agent API works
  • vite buildNeeds a build script
  • distOr the outDir in your Vite config
  • Free and unlimitedStatic sites never count
  • Routes workRefreshing a route returns your app

The short answer

To deploy a Vite React app, give your coding agent the sentence below. Antideploy sees Vite in your package.json, runs npm run build, and serves the output folder, dist by default, as a static site. It is free on every plan and never counts against your apps or deploys.

Say this to your coding agent

Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.

What Antideploy detects

  • Vite. Detected from the vite dependency. Create React App, Astro, Gatsby and SvelteKit with the static adapter are treated the same way.
  • The build. It needs a build script in package.json, such as vite build. Without one there is no output folder, and Antideploy says so.
  • The output folder. dist, or the outDir your Vite config sets.
  • The start script. A start script that only runs a development server, such as vite or vite preview, is ignored. A real server script, such as node server.js, is kept and the project becomes an app with a server.

Variables in a Vite app

Vite copies variables that start with VITE_ into the built files while it builds. That has two effects.

  • Set a VITE_ variable before the build, because setting it afterwards cannot repair a build that already ran without it
  • Anyone who loads your site can read a VITE_ variable, so never put a secret in one
  • Secrets belong on a server, behind an API your app calls

Pages, links and refresh

React Router and similar libraries change the address in the browser without asking the server. If someone refreshes on /dashboard, the server has no file called dashboard. The server that hosts your files sends index.html for any address without a file extension, so your app loads and its router takes over. A missing file with an extension, such as a missing image, returns a 404.

Talking to an API

Do not use localhost for the API address, because on a visitor's computer localhost is their own machine. Read the address from a VITE_ variable, or use a relative path when the API is on the same site. If the API is a separate Antideploy app, it must allow your site's address with CORS. See how to deploy a full-stack app.

Step by step

  1. Check the build on your machine

    npm run build should pass and write a dist folder.

  2. Paste the sentence and approve one link

    Your agent starts a login and shows you a link and a code. Open it, check the code and click Approve.

  3. Open your address

    Your agent deploys and tells you where it is live, in the form my-app.antideploy.app, with HTTPS.

01Before you commit

Here's where it stops.

A platform that only tells you what it is good at is one you find the edges of in production. These are the ones to know before your first deploy.

  1. Apps sleep when idle

    On every plan, an app nobody is using goes to sleep and the next visit wakes it. The first request took 2.9 to 13.9 seconds in our measurements, depending on the stack. There are no always-on workers, so use a cron job or a webhook for background work.

  2. One region

    Everything runs in Singapore, with the database beside the app. Users far from Asia will see slower responses.

02Questions

Vite questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Is a Vite app really free to host?

Yes. It is a static site. Static sites are free on every plan, forever, and never count against your apps or deploys.

Why is the first visit slow?

Static sites sleep when idle like every app. Measured on 19 September 2026, the first request after sleeping took 6.3 to 6.6 seconds for a Vite single-page app, and the next request about 0.16 seconds.

Can I use my own domain?

Yes, from the Go plan, with HTTPS included. Free accounts get an address ending in .antideploy.app that they can rename.

My build fails with "Could not resolve". What is wrong?

Usually an import whose path or capital letters do not match the file, because the build runs on Linux. See Module not found.

Can I add a backend later?

Yes. Add a server and the project becomes an app with a server, with the same address.

Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.