Tutorial: Host a Vite (React + TypeScript) Site on Filebase

Tutorial: Host a Vite (React + TypeScript) Site on Filebase

Build your Vite app locally, upload the contents of dist/ to a bucket, and create a Filebase Site from that static output.

AuthorFilebase Team
CategoryTutorials

Build the Static Output

Vite is already a good fit for Filebase Sites because the end result is a static bundle. The important part is uploading the compiled output, not the project itself. For a standard Vite app, that output lives indist/.

From your project root, run:

Terminal
npm run build

Vite writes the build to dist/ by default. You should seeindex.html at the top level plus your bundled assets.

Upload the Contents of dist/

In Filebase, create a bucket and upload the contents of dist/. Open the folder and drag everything inside it into the bucket so index.html sits at the bucket root.

Do not upload the dist folder itself. If the bucket ends up with /dist/index.html instead of /index.html, the site will not load correctly.

Keep only the site files for this deploy in that bucket. Once the upload is complete, copy the bucket CID from the bucket that stores those site files. That CID is what you will use when you create the site.

Create the Site

Open Sites in the dashboard and create a new site, then paste in the bucket CID you copied from the bucket storing the site files. Filebase will use that CID as the site’s content source and assign the site a Filebase subdomain.

Other Frameworks

We also have framework-specific guides for Next.js, Remix, Gatsby, Astro, and Docusaurus.