This episode covers taking a Vue application to production: deploying to Vercel, Netlify, and Firebase Hosting, SPA hosting with rewrite rules, configuring environment and build-time variables, plus a safe production deploy flow.

After all the episodes building the application, it's time to ship it into the real world. Deployment is the moment code becomes a product: the build must be correct, the environment must fit, and every route must work on the production domain.
Episode 20 covers how to take a Vue application to production: deploying to Vercel and Netlify, SPA and static site hosting including rewrite rules, configuring environment and build-time variables, plus a production deploy flow that can be repeated safely.
Vercel and Netlify build automatically from the repo using the same commands:
npm install
npm run buildThe build produces a dist folder containing HTML, JavaScript, CSS, and static assets. The platform auto-detects the Vue framework and puts a CDN in front of the build output.
For full control, use the CLI:
npm install -g vercel
vercel --prodvercel --prod uploads the build to production. Preview URLs can also be created before production for the team to review — a feature that makes deploying far less scary.
An SPA with vue-router uses History mode, so every route must be pointed at index.html:
/* /index.html 200/* /index.html 200 makes Netlify send every path to the application. Without this rule, refreshing at /produk/1 shows a 404.
Vercel uses vercel.json for the same effect:
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}"source": "/(.*)" catches every route and forwards it to index.html. The JavaScript router decides which page is shown.
Firebase also offers static hosting:
npm install -g firebase-tools
firebase init hosting
firebase deploy --only hostingfirebase deploy --only hosting uploads the dist folder to Firebase's CDN. Firebase Hosting is a good fit when the application already uses other Firebase ecosystem services.
VITE_ variables are replaced at build time, not at runtime:
VITE_API_BASE_URL=https://api.example.com npm run buildVITE_API_BASE_URL is baked into the bundle during build. Its value can differ per environment: staging uses the staging URL, production uses the production URL. Make sure secrets never enter build variables.
On Vercel and Netlify, set variables in the dashboard or a config file, and those values are automatically used during the build. Store values in the platform's secret manager, not in the repo.
main branch as the production source and staging for previews.Warning
Don't deploy straight to production during peak hours. Prepare a release window, and always have a fast way back to the previous version if a regression occurs.
Episode 20 delivered your application to production: correct builds for Vercel and Netlify, rewrite rules for SPA hosting, Firebase Hosting as an alternative, build-time environment variables, and a deploy flow that repeats safely.
Key takeaways:
VITE_ variables are resolved at build time.In the next episode 21, we'll cover server-side rendering and Nuxt — SSR basics with Nuxt.js, hybrid rendering and static generation, Nuxt's data fetching model along with middleware, and when to choose SSR over an SPA.