docs: add information on --envName flag (#28909)

This commit is contained in:
Till Sanders 2024-11-02 22:41:09 +01:00 committed by Daniel Roe
parent b2accc6de7
commit 43f2101587
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -41,10 +41,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" to="https://www.youtube.com/watch?v=DFZI2iVCrNc" target="_blank"}
Watch a video from Alexander Lichter about the env-aware `nuxt.config.ts`.
::