Skip to content

docs: list supported configuration file names - #4517

Open
tarikermis wants to merge 2 commits into
nitrojs:mainfrom
tarikermis:docs/config-file-names
Open

docs: list supported configuration file names#4517
tarikermis wants to merge 2 commits into
nitrojs:mainfrom
tarikermis:docs/config-file-names

Conversation

@tarikermis

@tarikermis tarikermis commented Aug 8, 2026

Copy link
Copy Markdown

🔗 Linked issue

Closes #4505

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)

📚 Description

The configuration page never says which file names Nitro actually loads, so users cannot tell whether names such as .nitrorc.js, nitro.config.yaml, or .config/nitro.toml are supported.

This adds a complete “Supported configuration files” section and removes two claims that do not match Nitro's loader:

  • Nitro does not enable c12's packageJson option, so a nitro key in package.json is not loaded.
  • Nitro does not enable globalRc, so a home-directory .nitrorc is not loaded.

The page now lists the supported nitro.config.*, .config/nitro.*, .config/nitro.config.*, and extensionless .nitrorc forms, including their precedence.

I checked the list both against the c12 resolver used by Nitro and by running Nitro's real loadOptions() against temporary directories. The schema covers all supported extensions, and the negative cases above stayed unloaded.

Verification

  • pnpm lint passes.
  • The docs build passes with 359 routes prerendered and the new section present.
  • The config-loading probe confirms the documented names and precedence.

Verified on Linux with Node 22. Windows path handling was not tested, and the extension preference within a single basename is intentionally left undocumented.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Best Regards, Tarik

Document the exact configuration files Nitro loads via c12:
nitro.config.* (12 extensions), .config/nitro.* and
.config/nitro.config.*, plus the extensionless .nitrorc file.

Also remove two inaccurate claims: configuration via the
package.json nitro key and a .nitrorc in the user home
directory are not loaded (c12 packageJson/globalRc options
are not enabled by Nitro).

Closes nitrojs#4505
@tarikermis
tarikermis requested a review from pi0 as a code owner August 8, 2026 23:17
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@tarikermis is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The configuration documentation now lists supported Nitro configuration filenames, lookup order, project-root resolution, .nitrorc precedence, and inline Vite options. It replaces generic c12 guidance and removes the package.json configuration section.

Changes

Configuration documentation

Layer / File(s) Summary
Document configuration loading rules
docs/1.docs/50.configuration.md
The guide defines supported configuration filenames, lookup order, project-root resolution, .nitrorc merging precedence, and inline Vite configuration.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • nitrojs/nitro#4363: Expands supported Vite configuration file extensions used during configuration detection.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses issue #4505 by documenting supported filenames, extensions, lookup order, and unsupported variants.
Out of Scope Changes check ✅ Passed The changes are limited to the configuration documentation requested by issue #4505.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title uses the valid Conventional Commits format with the docs type and accurately describes the documentation change.
Description check ✅ Passed The description clearly explains the supported configuration filenames, precedence, removed claims, and verification performed.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/1.docs/50.configuration.md`:
- Around line 41-45: Update the configuration file lists in the Nitro
configuration documentation to reflect c12’s actual extension precedence,
placing JavaScript extensions before TypeScript extensions. Apply the same
ordering consistently to all three locations: nitro.config, .config/nitro, and
.config/nitro.config.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4397044-9b7b-49a4-bfdd-2009d3845724

📥 Commits

Reviewing files that changed from the base of the PR and between 52abde8 and 58863e9.

📒 Files selected for processing (1)
  • docs/1.docs/50.configuration.md

Comment thread docs/1.docs/50.configuration.md Outdated
c12 resolves .js before .ts for the same basename, so list the
extensions in the order they are actually checked.

Refs nitrojs#4505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Which config files are supported?

1 participant