Shipping
Deployment
Generated projects deploy like any project of their framework. FSD changes how code is organized, not how it is built. This page lists what each template produces and the settings hosts usually need.
Build output by framework
| Framework | Build command | Output | API base variable |
|---|---|---|---|
| React + Vite | npm run build | Static files in dist/ | VITE_API_URL |
| Vue + Vite | npm run build | Static files in dist/ | VITE_API_URL |
| Next.js | npm run build | Node.js server (next start) | NEXT_PUBLIC_API_URL |
| Nuxt | npm run build or npm run generate | Node.js server in .output/, or static files with generate | NUXT_PUBLIC_API_BASE |
| SvelteKit | npm run build | Depends on the adapter (adapter-auto by default) | PUBLIC_API_BASE |
Use Node.js 22.12.0 or later on the build machine, and 22.22.2 or later for Nuxt and SvelteKit. Most hosts read the version from .nvmrc or an engines field, or let you set it in the project settings.
Environment variables
The generated API client reads its base URL from the variable above. These variables are public: they are embedded in the browser bundle at build time, so set them in the host before building and never put secrets in them.
# React + Vite, Vue + Vite
VITE_API_URL=https://api.example.com
# Next.js
NEXT_PUBLIC_API_URL=https://api.example.com
# Nuxt (overrides runtimeConfig.public.apiBase)
NUXT_PUBLIC_API_BASE=https://api.example.com
# SvelteKit
PUBLIC_API_BASE=https://api.example.comReact and Vue: static hosting with an SPA fallback
Both templates use history-mode routing (React Router's createBrowserRouter, Vue Router's createWebHistory). Deep links such as /catalog only work when the host serves index.html for unknown paths.
// vercel.json
{ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }# Netlify: public/_redirects (copied into dist/)
/* /index.html 200location / {
try_files $uri $uri/ /index.html;
}Deploying under a sub-path such as GitHub Pages? Set Vite's base option to that path before building.
Next.js
Vercel detects the project with no extra settings. On your own server, build once and run the Node.js server:
npm ci
npm run build
npm run start # listens on PORT, default 3000Nuxt
npm run build produces a server-rendered app in .output/. Most hosts detect it automatically; on your own server, run it with Node.js. For a fully static site, use npm run generate and deploy .output/public.
npm run build
node .output/server/index.mjsSvelteKit
The template uses @sveltejs/adapter-auto, which detects Vercel, Netlify, and Cloudflare Pages during their builds. For any other target, install a specific adapter and set it in vite.config.ts:
npm install -D @sveltejs/adapter-node # Node.js server
npm install -D @sveltejs/adapter-static # static filesBefore you ship
Run npm run ci locally or in CI first: it runs the FSD architecture check, lint, type checks, and the production build that the host will run.