Skip to content
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

Empty env.d.ts #15

Closed
sarasamuel opened this issue Dec 9, 2021 · 1 comment
Closed

Empty env.d.ts #15

sarasamuel opened this issue Dec 9, 2021 · 1 comment

Comments

@sarasamuel
Copy link

I have defined my environment variables in a .env file in the root of my project, and when I run 'ng add @ngx-env/builder,' an env.d.ts file gets created in the src folder. However, that file contains only an empty template. Is the env.d.ts supposed to be automatically populated with the variables defined in the .env file?

@chihab
Copy link
Owner

chihab commented Dec 10, 2021

To access your environment variables you should use process.env object.
The .env.d.ts is here only so that the compiler doesn't complain when you access process.env.NG_APP_SOME_VAR in your TypeScript code.

I added some notes on the README section here https://github.com/chihab/ngx-env#good-practices, let me know if it not clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants