Migrate from Vercel
Stattic fits Vercel spaces that build into static files. It hosts generated HTML, CSS, JavaScript, images, fonts, SPA fallbacks, custom 404 pages, redirects, rewrites, and Basic Auth on Free. Plus also supports downloadable files and custom response headers. It does not run the Vercel platform runtime.
Before switching DNS, audit the space for Vercel-only behavior. If the site depends on request-time rendering, functions, middleware, ISR, or Vercel image optimization, move those features to static generation, a separate backend, or a third-party service first.
Static Next.js export
For Next.js, use static export. In Next.js 14 and newer, next export was removed; next build writes the static artifact when output: "export" is configured. See the Next.js integration for image handling and publish setup.
// next.config.ts
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "export",
// Optional: emit /about/index.html instead of /about.html.
// trailingSlash: true,
};
export default nextConfig;
bun run build
stattic publish ./out
What carries over
- Framework output that is static files and runs without a Node.js server.
- Next.js pages generated by static export, including App Router static routes and Pages Router routes that use
getStaticPropsandgetStaticPaths. - Static assets, generated HTML, client-side JavaScript, SPA fallbacks, and custom 404 pages.
- Redirect, rewrite, and Basic Auth intent after conversion from
vercel.json. Plus also carries over supported custom response headers.
What to change
- Convert
vercel.jsonredirects and rewrites into root_redirects. External rewrites become absolute-URL200proxy rules. - Convert
vercel.jsonheaders into root_headers. Free applies onlyBasic-Auth; custom response headers require Plus. - Replace server-only framework features with static generation, external APIs, or client code before publishing.
- Move Vercel environment variables into the CI or agent process that builds the static artifact. Only values embedded at build time or exposed to browser code will be available after publish.
Next.js images
Vercel's default next/image optimization endpoint is request-time infrastructure. Static export requires either unoptimized images, pre-generated responsive assets, or a custom image loader.
Use the Next.js integration to configure static export and send public images through i0.wp.com. For transform limits and advanced options, see Image acceleration.
Limitations
These Vercel and Next.js features need removal, build-time precomputation, or another service:
- Vercel Functions, Edge Functions, Middleware, Cron Jobs, serverless API routes, and request-time OG image generation do not execute.
- SSR,
getServerSideProps, Draft Mode, Preview Mode, on-demand revalidation, ISR, partial prerendering that needs a runtime, and dynamic rendering from cookies or headers are unavailable. - Next.js static export does not support API Routes, default Image Optimization, internationalized routing, rewrites, redirects, headers, Proxy, or
getStaticPathswithfallback: trueorfallback: "blocking". Recreate routing and headers with Stattic_redirectsand_headerswhere possible. - Vercel's
/_next/imageand/_vercel/imageoptimization endpoints are not present. Use the Next.js Site Accelerator loader,unoptimized, or pre-generated responsive image assets. - Vercel platform products such as Web Analytics, Speed Insights, Toolbar, Blob, KV, Postgres, Edge Config, Firewall rules, WAF-managed protections, and version protection do not transfer with the static artifact.
- Preview versions, branch aliases, space-level build settings, Vercel-managed environment variables, and Build Output API primitives are workflow/runtime features. Use CI or an agent workflow to build and publish explicit preview artifacts.