-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Use custom runtime environmental variables (instead of NUXT_ prefix) #23714
Copy link
Copy link
Open
Open
Documentation
Copy link
Description
Describe the feature
Refering to runtime configuration , I think that the current implementation (runtime variables will be overriden by NUXT_ prefixed environmental viariables) is kind of ugly.
The problem is that one may already have some env vars, e.g. (DB_URL), that might live in a common env file that is shared among many applications. With the current implementation we have to "pollute" the env file with duplicate definitions (e.g. add the NUXT_DB_URL in addition to the already existing, duplicating the variable content as well).
While, nuxt could just have a semantic to resolve arbitrary env vars (at runtime). e.g.
export default defineNuxtConfig({
runtimeConfig: {
apiSecret: '${APP_SECRET}' // This resolves the environment variable APP_SECRET at runtime
Using
nuxt version 3.6.5
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
Final checks
- Read the contribution guide.
- Check existing discussions and issues.
Reactions are currently unavailable