Repository navigation
Static Export
Louis Wright edited this page Oct 14, 2026
·
2 revisions
📄 Mirrors
docs/static-export.mdin the main repo — the repo version is canonical.
Status: planned / pre-release. This page documents the intended API of next-tongue. Nothing is published yet; names may change before v1.0. See ROADMAP.
output: 'export' produces plain HTML with no server and no proxy. next-tongue supports it with these rules:
-
Only
routing.prefix: 'always'is supported. Proxy/middleware does not run withoutput: 'export'(Next.js docs), so nothing can rewrite/about→/en/aboutor redirect/en/*. - Export
generateStaticParams = localeParamsfromapp/[locale]/layout.tsx(tongue init --exportwrites it); for nested dynamic segments, combine:localeParams().flatMap(({ locale }) => slugs(locale).map((slug) => ({ locale, slug }))). -
dynamicParams = falseis supported — next-tongue never relies on on-demand rendering of unknown locales (cf. amannn/next-intl#2060). - The root
/needs a redirect.tongue init --exportgeneratesapp/page.tsxthat renders a tiny static page with<meta http-equiv="refresh">plus a<link rel="alternate" hreflang>list, and optionally a host-level redirect snippet (Netlify_redirects, Vercelvercel.json, Cloudflare_redirects). -
localeDetectionhas no effect (no proxy). Add a client-side locale switcher.
// next.config.ts
export default withTongue({ output: 'export', cacheComponents: true });Unverified pairing.
cacheComponents: truetogether withoutput: 'export'is checked early in v0.1 (#15). If it does not build on the current 16.x, the export example dropscacheComponentsand this page will say so.
withTongue fails the build if output: 'export' is combined with prefix: 'as-needed' | 'never' or domains.
Guides
- Getting Started
- Configuration
- Routing and Proxy
- Server Components
- Client Components
- Server Actions
- ICU Messages
- Type Safety
- Cache Components and PPR
- Static Export
- Metadata SEO and hreflang
- Database and CMS Messages
- Dev Tools
- Translator Workflow
- Per-user Preferred Language
- CLI
- AI Translation
- Testing
- VS Code Extension
- Migration from next intl
- Migration from next international (deferred)
Reference