Open abhi12299 opened 2 months ago
This is an issue related to a draft PR I raised in https://github.com/nuxt/cli/pull/466
setupDotEnv
.env
FLAG
process.env.FLAG
Reproduce the issue: https://stackblitz.com/edit/stackblitz-starters-xnps4y?file=.env,index.js
I have introduced an override flag in DotenvOptions, which gives precedence to the env variable values in the .env file over the existing values in process.env.
override
DotenvOptions
process.env
With this change, the PR https://github.com/nuxt/cli/pull/466 can be simplified and we can use this new flag directly.
This is an issue related to a draft PR I raised in https://github.com/nuxt/cli/pull/466
Issue Description
setupDotEnv
function is called with a.env
file. Assume that the only env var loaded isFLAG
.FLAG
variable's value is updated in the.env
file by the running process.setupDotEnv
is called again, but the value ofprocess.env.FLAG
is not changed.Reproduce the issue: https://stackblitz.com/edit/stackblitz-starters-xnps4y?file=.env,index.js
I have introduced an
override
flag inDotenvOptions
, which gives precedence to the env variable values in the.env
file over the existing values inprocess.env
.With this change, the PR https://github.com/nuxt/cli/pull/466 can be simplified and we can use this new flag directly.