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

environment configuration alias docs ($production, $development and $test) #25812

Closed
lassediercks opened this issue Feb 15, 2024 · 6 comments
Closed

Comments

@lassediercks
Copy link
Contributor

lassediercks commented Feb 15, 2024

In Getting Started with Unit Tests using $test is the suggested way of handling api requests.

@danielroe provided an example in a PR discussion but besides that there is no documentation about that feature

export default defineNuxtConfig({
  $test: {
    runtimeConfig: {
      apiBase: ''
    }
  }
})

image

@danielroe danielroe changed the title Missing Documentation for $test environment configuration alias support Feb 16, 2024
@danielroe danielroe changed the title environment configuration alias support environment configuration alias docs ($production, $development and $test) Feb 16, 2024
@riddla
Copy link
Contributor

riddla commented May 8, 2024

There is some documentation over at https://github.com/unjs/c12#environment-specific-configuration. At least I think that this is the underlying feature used in the nuxt.config.

@manniL
Copy link
Member

manniL commented May 8, 2024

I agree that this should be covered in the docs though and not only in c12 or in video content 👍🏻

@manniL
Copy link
Member

manniL commented May 12, 2024

It is also documented in https://nuxt.com/docs/getting-started/configuration#environment-overrides, which should suffice. Feel free to point out what is missing if you disagree ☺️

@manniL manniL closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
@maartenvanhunsel
Copy link

@manniL is it possible to change the envname withing Nuxt? https://github.com/unjs/c12?tab=readme-ov-file#envname
For example I would like to use the NUXT_SITE_ENV variable to determine the environment.

@manniL
Copy link
Member

manniL commented May 15, 2024

@maartenvanhunsel follow along nuxt/cli#357 ☺️

@lassediercks
Copy link
Contributor Author

I do agree that the environment overrides section does greatly document the feature.

Following my personal scenario: from a perspective of someone that explores the nuxt docs for the first time there is still not clear indication what $test is refering to
image

Here is my idea how to battle that: #27315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants