NODE_ENV not set initially prior to configValidation for 'npm run build' #8549
-
|
Hi folks, I'm trying out using dotenv to dynamically set different values for For example... In Then, I have separate dotenv files as such and Now, with this config setup, if I run However, if I run Would anyone be able to assist? Am I missing something here? Further info. I made the following second attempt to check something... I added a fallback value for that and I noticed that So it looks like the first time through, Do you think this is a bug worth reporting? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
@miller-productions Try this one require('dotenv').config()
const config = {
title: 'my title',
tagline: 'my tagline',
url: process.env.DOCS_URL || 'https://my-docs.someurl',
}It will work for you |
Beta Was this translation helpful? Give feedback.
-
|
@miller-productions Indeed, we load the config once before we even set @slorber Do you think we should make sure every command has a |
Beta Was this translation helpful? Give feedback.
-
|
Created issue at #8599 |
Beta Was this translation helpful? Give feedback.
@miller-productions Try this one
It will work for you