-
Notifications
You must be signed in to change notification settings - Fork 16
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
Set the environment with--configuration option #45
Comments
Could you try this?
It should pick .env.production and .env if present |
This worked though I had to use different syntax (Windows).
However I can't do this for example
results in
Why wouldn't be providing configuration with the --configuration option enough? |
maybe you'd want to use cross-env package to set the environment variable.
Your other suggestion to set NG_APP_ENV to the configuration option (when not set via NODE_ENV/NG_APP_ENV) is also interesting, thinking about it. |
I intuitively assumed that this environment would be set if I used the --configuration option, but I guess not 😅 Please do consider this as an option. This package would be a good replacement for the built-in file replacements with minimal effort if this was the default behavior, in my opinion. |
Available in @ngx-env/builder 17.0.6 |
The extension/CLI is not picking up .env files for example .env.production (present in the same dir as package.json) with NG_APP_ENV being undefined even though valid Angular configuration was provided through ng build.
PS C:\Git\myproj> ng build --configuration production
------- @ngx-env/builder -------
✔ C:\Git\myproj.env
✔ NG_APP_ENV => undefined
✔ NG_APP_API_FQDN
✔ NG_APP_API_URL
None of the default (development, production) files are being picked up, it only detects .env and .env.local (if I place it in the same dir).
The text was updated successfully, but these errors were encountered: