[All articles](https://linkinseconds.com/blog)

# How to deploy a React or Vite build the easy way

[Sunny](https://linkinseconds.com/about#who-runs-this)·August 31, 2026· 7 min read

[#hosting](https://linkinseconds.com/blog/topic/hosting-and-websites)[#ai](https://linkinseconds.com/blog/topic/ai-agents-and-developers)#deploy#react#vite

You ran **npm run build**, watched it churn, and got a **dist/** folder. That folder _is_ your app: every route, every component, compiled down to static files. The only thing between it and a public URL is "somewhere to put it," and that step is usually wrapped in far more ceremony than it needs. Here's the easy way, plus the two details that actually matter for a front-end build.

## Your build is already a static site

This is the key realization: a production front-end build is, by design, a [folder of static files you can host from a ZIP](https://linkinseconds.com/blog/host-a-static-website-from-a-zip). Vite writes **dist/**, Create React App writes **build/**, a static export writes **out/**. Each is an **index.html** plus fingerprinted JavaScript and CSS bundles and your assets. No server is required to serve them. So you don't need a deploy platform with a build pipeline; you just need [somewhere to drop the files](https://linkinseconds.com/share-files-online).

## The easy way

- **Build.** Run **npm run build** (or your tool's equivalent).

- **Zip the output folder.** Compress **dist/** (Vite), **build/** (CRA), or **out/** (static export). Zipping the whole project is fine too. The output folder is detected automatically.

- **Upload the ZIP.** Every file is served with the right type: your bundle as **text/javascript**, styles as **text/css**, fonts as **font/woff2**, which is exactly what the browser needs to boot the app.

- **Turn on SPA mode, add your domain.** Enable single-page-app fallback for client-side routing, and on Pro connect your own domain with automatic SSL.

Try it while you read

Drop any file here and get a clean link with a QR code in seconds.

Drop your file here

Drop several at once and they become one album link

or paste an image Ctrl+V

Up to 10 GB per file. 7-day free trial, then $9/mo + tax. $0 today, cancel anytime.

## Detail #1: client-side routing needs a fallback

A single-page app routes in the browser. Your React Router or Vue Router owns **/dashboard** and **/settings**. There are no **dashboard.html** files on disk. So when a visitor opens a deep link directly, or hits refresh on an inner page, the server has to hand back **index.html** so your router can take over. That's what **single-page-app mode** does: unknown paths fall back to index.html with a 200, so refreshes and shared deep links resolve instead of returning a 404. If you're building a plain multi-page site, leave it off and unknown paths return a real 404 (or your own **404.html**).

Symptom to recognize: the app works when you click into a route from the home page, but a hard refresh or a pasted deep link 404s. That's the SPA fallback missing. Turn it on and it's fixed.

## Detail #2: caching hashed bundles the right way

Your bundler fingerprints filenames (**index.4f3a9c2b.js**) precisely so they can be cached aggressively: the name changes whenever the contents do. The correct setup caches those content-hashed assets with a **one-year immutable** cache, so repeat visits load instantly from cache, while **index.html** is served **no-cache** so a new deploy shows up immediately. Done right, you get the speed of hard caching without the classic stale-HTML bug where an old page points at bundles that no longer exist. Ship an update by uploading a fresh ZIP: same URL, new version on the next load.

## What's out of scope

Static hosting serves your built files and nothing else. Calls from the browser to an external API over HTTPS keep working. What doesn't: anything that needs a server at request time, such as Next.js server components rendered per request, SvelteKit endpoints, server middleware, secrets read on the server. For those, export a fully static build or use a platform that runs the server. Bring built static output and you get a [fast, simple host on its own subdomain](https://linkinseconds.com/blog/host-website-zip-free-subdomain) (website hosting is on Pro); bring a server-dependent app and this is the wrong tool.

## Ship it

Build, zip **dist/**, and drop it on the [deploy a Vite or React build](https://linkinseconds.com/deploy-vite-react-build) page. If you just want a built site online in general, the [host a static website](https://linkinseconds.com/host-static-website) guide covers the same flow, and [publish an HTML ZIP](https://linkinseconds.com/publish-html-zip) is the plain-HTML version.

## Keep reading

- [How to share a Lovable, Bolt or v0 app as a link (export and host it) 6 min read](https://linkinseconds.com/blog/share-a-lovable-bolt-or-v0-app-as-a-link)

- [GitHub Pages vs Link in Seconds for hosting a static site 6 min read](https://linkinseconds.com/blog/github-pages-vs-link-in-seconds)

- [HTML file to link: share it as a live web page 8 min read](https://linkinseconds.com/blog/share-an-html-file-as-a-link)

## Turn any file into a link in seconds

Upload a PDF, image, video, or ZIP and get a clean, trackable link with a QR code. Up to 10 GB per file. 7-day free trial, then $9/mo + tax. $0 today, cancel anytime.

[Start free trial →](https://linkinseconds.com/)

Optional cookies for analytics, ads and session replay. · [Privacy](https://linkinseconds.com/privacy)

Source: https://linkinseconds.com/blog/deploy-a-react-vite-build-the-easy-way
