DEV Community

Discussion on: Managing .env variables for provisional builds with Create React App

Collapse
 
foxbit19 profile image
foxbit19

Thanks for your article! I think env-cmd needs -f argument to load the custom file correctly. Otherwise it fails and load .env file by default.

Collapse
 
donghyukjacobjang profile image
Donghyuk (Jacob) Jang

Thanks for this information. When this article was written, it was using env-cmd version 8.0.2. It was not required -f option. I also just tested the latest version which is 9.0.3 without the parameter and caused an issue. As a result, when pointing a custom env file, it is required. Thank you so much @foxbit19 .