here Hi all I am quite…

less than 1 minute read

@here Hi all, I am quite new with nx and wondering what is the best approach to handle different environments configurations. It seems it’s usually handled by replacing env config files within nx workspace configuration, which is not as good solution as i would like to have. React supports dotenv and handling env configuration is very simple ( I found the following issue where dotenv is apparently supported, but it doesn’t work in my case. I am starting up my app locally with nx serve command which is configured in nx workspace. I tried to implement run-commands wrapper serve command and set env file as it is written in the issue above: ““architect”: { “serve-wrapper”: { “builder”: “@nrwl/workspace:run-commands”, “options”: { “commands”: [ { “command”: “nx serve –configuration=local-docker” } ], “envFile”: “apps/my-app/.env” } }, … “ However, the app still doesn’t see variables from .env file. Could you please advise about how do you handle diff env configs and if i did something wrong above? Thank you. Create React App · Set up a modern web app by running one command.