Hello I have an env var like the following in the nuxt.config.js
env: {
BAR: process.env.BAR
}
The problem is that I need to load from os env var instead of .env
file so I tried to use NUXT_ENV_ like this:
I load the env var with
export NUXT_ENV_BAR='value'
1 Try
env: {
BAR: process.env.NUXT_ENV_BAR
}
....
console.log(process.env.BAR)
....
2 Try
....
env: {
NUXT_ENVBAR: process.env.NUXT_ENV_BAR
}
console.log(process.env.NUXT_ENVBAR)
....
I tried the same with publicRuntimeConfig
instead of env
, but didn't work too.
How can I set os env var inside nuxt.js app?
Thanks