Skip to content

Conversation

Yizack
Copy link
Contributor

@Yizack Yizack commented Aug 6, 2025

πŸ”— Linked issue

Resolves #893

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Some people are using the .config folder alternative for projects with many configuration files, and since c12 from unjs and nuxt itself support .config folder would be nice to be able run tests using this alternative :)

Added support for detecting Nuxt apps that use config files inside the .config folder. I hardcoded the possible resolvable configs following the same pattern as the existing for default config files. No need to set coonfigFile option

Also added a dot-config test fixture in examples/module/test/fixtures

@Yizack Yizack requested a review from danielroe as a code owner August 6, 2025 16:39
@Yizack Yizack changed the title Support dot config fix: detect nuxt config files in .config folder Aug 6, 2025
Copy link

pkg-pr-new bot commented Aug 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@1381

commit: d624817

@Yizack Yizack changed the title fix: detect nuxt config files in .config folder fix(e2e): detect nuxt config files in .config folder Aug 10, 2025
|| existsSync(resolve(dir, 'nuxt.config.cjs'))
|| existsSync(resolve(dir, 'nuxt.config.ts'))
|| existsSync(resolve(dir, '.config', 'nuxt.js'))
|| existsSync(resolve(dir, '.config', 'nuxt.mjs'))
Copy link
Member

Choose a reason for hiding this comment

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

thank you!

maybe ultimately we might try to get a resolveConfigPath into c12 so we have one location for configuration resolution (cc: @pi0)

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense! Feel free to open an issue so we don't forget!

@danielroe danielroe merged commit 868b5b7 into nuxt:main Aug 11, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request Aug 11, 2025
@github-actions github-actions bot mentioned this pull request Sep 6, 2025
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.

e2e tests fail with .config/nuxt.ts
3 participants