Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command creates nuxt.config.ts while nuxt.config.js exists #400

Open
meirroth opened this issue Apr 28, 2024 · 2 comments · May be fixed by #401
Open

add command creates nuxt.config.ts while nuxt.config.js exists #400

meirroth opened this issue Apr 28, 2024 · 2 comments · May be fixed by #401
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@meirroth
Copy link

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.

@danielroe danielroe added bug Something isn't working good first issue Good for newcomers labels Apr 29, 2024 — with Volta.net
Copy link
Member

The issue is here:

const nuxtConfigFile = resolve(rootDir, 'nuxt.config.ts')
.

We should support iterating over a list of possible files and picking the first.

@meirroth meirroth linked a pull request Apr 29, 2024 that will close this issue
@meirroth
Copy link
Author

@danielroe I created a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants