From f0d6e733d31a6b7b5153bb752678bef874914b8d Mon Sep 17 00:00:00 2001 From: Till Sanders Date: Tue, 10 Sep 2024 12:29:35 +0200 Subject: [PATCH] docs(configuration): add --envName flag Documentation accompanying the PR for Nuxt CLI: https://github.com/nuxt/cli/pull/424 (currently in review) --- docs/1.getting-started/3.configuration.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/1.getting-started/3.configuration.md b/docs/1.getting-started/3.configuration.md index 49a0822ecb..a2e96fddfe 100644 --- a/docs/1.getting-started/3.configuration.md +++ b/docs/1.getting-started/3.configuration.md @@ -42,10 +42,17 @@ export default defineNuxtConfig({ }, $development: { // - } + }, + $myCustomName: { + // + }, }) ``` +To select an environment when running a Nuxt CLI command, simply pass the name to the `--envName` flag, like so: `nuxi build --envName myCustomName`. + +To learn more about the mechanism behind these overrides, please refer to the c12 documentation on [environment-specific configuration](https://github.com/unjs/c12?tab=readme-ov-file#environment-specific-configuration). + ::tip{icon="i-ph-video-duotone" to="https://www.youtube.com/watch?v=DFZI2iVCrNc" target="_blank"} Watch a video from Alexander Lichter about the env-aware `nuxt.config.ts`. ::