Configure options below — the preview updates in real time.
Fundamental settings for React mode, output strategy, routing, and base paths.
Alters the build output. 'standalone' creates a minimal server trace (ideal for Docker). 'export' enforces static HTML output.
Deploy a Next.js app under a sub-path of a domain (e.g. /docs). Must start with '/'.
CDN prefix for static assets (e.g. https://cdn.example.com).
Custom build output directory instead of the default .next folder.
Server-side behavior, compression, headers, caching, and font optimization.
Timeout in seconds for getStaticProps before a single page generation is aborted.
Maximum memory (in bytes) for the in-memory cache. Set to 0 to disable.
Path to a custom cache handler file for persisting cached data (e.g. Redis).
Build behavior, TypeScript, and clean-up settings.
Base root directory for output file tracing (useful in monorepos).
Path to a custom TypeScript configuration file.
URL normalization, trailing slash behavior, file-system routing, and page extensions.
File extensions the router recognizes as page files.
Additional origins that are allowed to request the development server.
Configure the built-in Next.js Image Optimization API.
Allow-listed external URL patterns for image optimization (e.g. https://example.com/account123/**).
Allowed optimized image output formats.
Minimum cache time-to-live in seconds for optimized images. Changed to 14400 (4 hours) in Next.js 16.
Image loader to use instead of the built-in optimizer. Use 'custom' with a loaderFile for custom providers.
Path to a custom image loader file (relative to project root). Required when loader is set to 'custom'.
Expose build-time environment variables to the JavaScript bundle.
Key-value pairs exposed at build time (available in both server and client code).
CORS attributes for scripts and HTTP agent configuration.
CORS crossorigin attribute added to all generated <script> and <link> tags.
Configure terminal logging for development and debugging.
Control dependency bundling, transpilation, and server external packages.
NPM packages to transpile through the SWC compiler pipeline.
Node.js packages to exclude from the Server Components bundler (use native require).
Pages Router internationalized routing settings.
The default locale for the application (e.g. en).
List of all supported locales.
Development server indicators and on-demand entry caching behavior.
Show the on-screen route indicator during next dev. Set to false to hide. In Next.js 16, buildActivity and buildActivityPosition were removed; use position instead.
Position of the development indicator on screen.
How long (in ms) a compiled page stays in memory without being accessed.
Number of pages to keep in memory simultaneously during development.
Advanced SWC compiler options for styled-components, emotion, and console removal.
Experimental and upcoming Next.js features. Use with caution as they may change.
Packages to auto-optimize by replacing full imports with scoped internal paths.
Stale time in seconds for dynamic pages in client-side router cache.
Stale time in seconds for static pages in client-side router cache.
Configure the bundled Sass compiler with include paths and prepended data.
Additional directories for the Sass compiler to resolve @import and @use.
Sass code prepended to every Sass file before compilation.
1import type { NextConfig } from "next";23const nextConfig: NextConfig = {};45export default nextConfig;6