Skip to content

Attempt to auto-detect configuration files with varying file extensions#139

Merged
JamesMGreene merged 4 commits intomainfrom
config-auto-detect
Mar 30, 2024
Merged

Attempt to auto-detect configuration files with varying file extensions#139
JamesMGreene merged 4 commits intomainfrom
config-auto-detect

Conversation

@JamesMGreene
Copy link
Copy Markdown
Contributor

@JamesMGreene JamesMGreene commented Mar 29, 2024

Context

Purpose

If no generator file path is manually provided as input, this change loops through our supported file extensions seeking the existence of a configuration file that matches the static site generator's chosen configuration file basename, e.g. for Next.js:

  • Does next.config.js exist?
  • If not, does next.config.cjs exist?
  • If not, does next.config.mjs exist?
  • If not, fallback to next.config.js and create the file

Risks

I did not add any new tests for this slight behavioral change as it basically boils down to a loop that checks for file existence. Feel free to push back if you feel more testing is needed. 😅

@JamesMGreene JamesMGreene requested a review from a team as a code owner March 29, 2024 02:17
@JamesMGreene JamesMGreene merged commit 983d773 into main Mar 30, 2024
@JamesMGreene JamesMGreene deleted the config-auto-detect branch March 30, 2024 00:48
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.

Doesn't recognize next.config.mjs Supported configuration file extension check does not use the per-generator default

2 participants