next.config.js: Introduction | Next.js
nextjs.org · 1,372 words · saved by 1 readers
learn more about the configuration file used by Next.js to handle your application.
This page is also available as Markdown at /docs/app/api-reference/config/next-config-js.md . For an index of Next.js documentation , see /docs/llms.txt . Copy page next.config.js Last updated November 4, 2025 Next.js can be configured through a next.config.js file in the root of your project directory (for example, by package.json ) with a default export. next.config.js // @ts-check /** @type {import('next').NextConfig} */ const nextConfig = { /* config options here */ } module . exports = nextConfig ECMAScript Modules next.config.js is a regular Node.js module, not a JSON file. It gets used
related reading
- Next.js Docsnextjs.org
- Getting Started: Caching | Next.jsnextjs.org
- File-system conventions: loading.js | Next.jsnextjs.org
- Getting Started: Layouts and Pages | Next.jsnextjs.org
- Getting Started: Error Handling | Next.jsnextjs.org
- next.js/examples at canary · vercel/next.jsgithub.com
- Cursor Docs — Agent, Rules, MCP, Skills & CLIdocs.cursor.com
- How Mozilla’s Rust dramatically improved our server-side performance | Figma Blogfigma.com
- Building a single-page application with Next.js and React Routercolinhacks.com
- API Reference: Edge Runtime | Next.jsnextjs.org
- React Foundations: Installing Next.js | Next.jsnextjs.org
- React Foundations | Next.jsnextjs.org