Where Is the Nuxt Config File?
Nuxt reads nuxt.config.ts at the project root for modules, runtime config, and build behavior.
Last updated
Nuxt configures from nuxt.config.ts at the project root. Modules, runtime config, app head, and devtools toggles live there in one typed file. Scaffolding writes the baseline on init.
Environment overrides layer through .env files and runtimeConfig without touching the file. Server and client folders follow conventions beside it. Version 2 projects used nuxt.config.js instead, which explains older guides.
Where Nuxt stores this, by platform
[ProjectDir]/nuxt.config.ts
Root config with defineNuxtConfig wrapper. Pages route from the pages folder by convention. Exact keys vary between Nuxt 2 and 3.
[ProjectDir]/nuxt.config.ts
Same root file on Mac. Output builds into .output while Nuxt 2 used dist. Keep .nuxt and .output out of git.
[ProjectDir]\nuxt.config.ts
Same file on Windows. Secrets belong in .env and runtimeConfig, never committed. Build output stays disposable.
Frequently asked questions
Where do Nuxt secrets go?
In runtimeConfig inside the config backed by .env values. Private keys stay server side while public ones expose deliberately. Never commit .env itself.
Why does my old Nuxt guide reference nuxt.config.js?
Nuxt 2 used the .js filename with a different option set. Nuxt 3 moved to TypeScript config. Match guides to your major version.
Notice an outdated path? Let us know.