Deploying Vite & React Applications
Deploy lightning-fast Vite React, Vue, or Svelte single-page applications with automated client-side SPA routing.
Step-by-Step Overview
Vite on AcadSites Edge
Vite single-page applications (SPAs) are compiled to static HTML, CSS, and minified JavaScript bundles. On AcadSites, these assets are distributed globally across our edge CDN, providing sub-30ms load times and automated HTTPS.
Automatic Client-Side Routing (SPA Fallback)
A frequent challenge with Single Page Applications on traditional web hosts is encountering 404 Not Found errors when visitors reload a deep URL (e.g. /dashboard or /user/profile). AcadSites automatically configures an edge SPA rewrite: all non-file route requests fallback smoothly to index.html, allowing React Router to handle page resolution.
You do not need to create custom _redirects or .htaccess files. AcadSites enables SPA fallback automatically for Vite projects.
Vite Environment Variables
Vite requires client-accessible variables to start with the VITE_ prefix. These variables are statically replaced during build time:
// Evaluated during build time
export const API_URL = import.meta.env.VITE_API_URL || 'https://api.example.com';
export const STRIPE_KEY = import.meta.env.VITE_STRIPE_PUBLIC_KEY;Ready to experience zero-overage cloud hosting?
Deploy your React, Next.js, or Node.js application in under 60 seconds with automated SSL.