N
Nuxt4mo ago
lac

Exposing ENV Variables for nuxt.config

Hey. Any suggestions on how to expose env variables in runtime? I've read about NUXT_ prefix, that works for runtimeConfig, but I need to expose the env variables I use in the nuxt config file itself. There I cannot use runtimeConfig unfortunately. Looking through the compiled files it seems like the process.env expressions are evaluated at build time.
2 Replies
lac
lacOP4mo ago
Looking through the compiled files it seems like the process.env expressions are evaluated at build time.
I wasn't looking closely enough. The values I was looking at were the defaults, but the the env vars can be overwritten in prod
lac
lacOP4mo ago
Nuxt
.env · Nuxt Directory Structure
A .env file specifies your build/dev-time environment variables.
Want results from more Discord servers?
Add your server