-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple env files log correctly but have a different effect #100
Comments
What version of the package are you using please? |
I'm using 17.3.0. |
The environment follows this rule: process.env.NG_APP_ENV || // @deprecated
process.env.NODE_ENV || // default in @dotenv-run/core
builderConfiguration // the angular build configuration Example: if you set NODE_ENV the builder configuration is ignored Would it be possible to provide a repo reproducing the issue (you can fork it on stackblitz from here: https://stackblitz.com/edit/ngx-env-3ey8js) Which builder are you using: application, browser-esbuild or browser? |
Sorry, I didn't have the time to build a new example from the Stackblitz. I tried to reduce my own project to a small reproducible example. I am running
But the page is rendered as:
So to me it seems like there are two issues here:
|
Hi. First of all, thanks for creating the project and keeping it active. It's a good addition that Angular is lacking.
I am trying to inject different configurations into my Angular application with @ngx-env/builder. However, it seems that the env files are not loaded correctly. I am running
myapp:serve:development
. This is the output when building:Seems valid to me. However,
NG_APP_BACKEND_API_URL
does not actually have the value that is defined in.env
, as it is suggested by that console log, but rather the value that is defined in a separate.env.development
. If I delete the latter, then the correct value is used.On the other hand, if I run
NODE_ENV=devxx myapp:serve:development
, this is the output:Again, completely reasonable and what I would expect. But again, that's actually not showing the truth:
env.devxx
is completely ignored and the values from.env
are used.So, apparently
NODE_ENV
is used only for logging but for the actual values, the angular build configuration is used?The text was updated successfully, but these errors were encountered: