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

docs: describe environment override feature #21879

Merged
merged 4 commits into from
Jul 1, 2023
Merged

Conversation

adityarawat1223
Copy link
Contributor

@adityarawat1223 adityarawat1223 commented Jul 1, 2023

πŸ”— Linked issue

#21616

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ 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

I have Defined Newly added Environment config override feature

Resolved #21616

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Jul 1, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nuxt-studio
Copy link

nuxt-studio bot commented Jul 1, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview f931517

docs/1.getting-started/3.configuration.md Show resolved Hide resolved
@@ -29,6 +29,24 @@ Every configuration option is described in the [Configuration Reference](/docs/a
You don't have to use TypeScript to build an application with Nuxt. However, it is strongly recommended to use the `.ts` extension for the `nuxt.config` file. This way you can benefit from hints in your IDE to avoid typos and mistakes while editing your configuration.
::

You can configure fully type , per-environment overrides in your nuxt.config

Copy link
Member

Choose a reason for hiding this comment

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

cc: @danielroe Could we suggest that these overrides are applied based on the key matching the NODE_ENV environment variable at dev time and build time (if that's how it actually works) ?

Maybe explicitly show an example of how a config that has both $production and $development keys will be resolved ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for suggestion i committed your suggestion now what to do ?

Co-authored-by: Hebilicious <xsh4k3@gmail.com>
docs/1.getting-started/3.configuration.md Outdated Show resolved Hide resolved
@danielroe
Copy link
Member

Thank you ❀️

@adityarawat1223
Copy link
Contributor Author

Sorry if its a dumb question but is this issue done now ? can i move on to others ?

@danielroe
Copy link
Member

Yes, this looks good to me. I'm going to go ahead and merge but it's possible @Hebilicious may have other ideas for improving the docs here?

@danielroe danielroe changed the title docs : Describing newly added Environment config override feature docs: describe environment override feature Jul 1, 2023
@danielroe danielroe merged commit 6cf762f into nuxt:main Jul 1, 2023
2 checks passed
@github-actions github-actions bot mentioned this pull request Jul 1, 2023
@Hebilicious
Copy link
Member

Yes, this looks good to me. I'm going to go ahead and merge but it's possible @Hebilicious may have other ideas for improving the docs here?

Could we suggest that these overrides are applied based on the key matching the NODE_ENV environment variable at dev time and build time (if that's how it actually works) ?

Maybe explicitly show an example of how a config that has both $production and $development keys will be resolved ?

@danielroe
Copy link
Member

danielroe commented Jul 1, 2023

I worry that mentioning NODE_ENV would be more confusing as it's not something that users should ever set themselves.

But perhaps saying that development is when running nuxi dev, while nuxi build and nuxi generate are production? Is that obvious?

@Hebilicious
Copy link
Member

I worry that mentioning NODE_ENV would be more confusing as it's not something that users should ever set themselves.

But perhaps saying that development is when running nuxi dev, while nuxi build and nuxi generate are production? Is that obvious?

Best of both worlds, we explicitly mention NODE_ENV, and we could just say that it's automatically handled by the nuxi commands by default and it's not necessary to manually touch it. As a user the first thing that comes to my mind is "how does it works".

@danielroe
Copy link
Member

Sounds good πŸ‘

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

Successfully merging this pull request may close these issues.

[Documentation Request] Environment config override
3 participants