`add` command creates `nuxt.config.ts` while `nuxt.config.js` exists
Not sure if this expected, when running the add command (for example npx nuxi@latest module add nuxt-viewport) in a project using nuxt.config.js a new file is created nuxt.config.ts with the new module:
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["nuxt-viewport"]
})
I would expect it to add the new module to the exisiting config file.
Reproduce this issue on StackBlitz starter: https://stackblitz.com/fork/github/nuxt/starter/tree/v3-stackblitz
Apologies if this is an upstream issue.
The issue is here: https://github.com/nuxt/cli/blob/89731870dac34a443febf5974f0515596b17914b/src/commands/module/add.ts#L119.
We should support iterating over a list of possible files and picking the first.
@danielroe I created a PR