In ReactJS, I created a .env file to read values. I was able to successfully read it both locally and in production. This is correct behavior.
My Question - I had added .env file in .gitignore file. So according to me, it should still work in development environment but should not work in production since .env was gitignored. How is it working?