TL;DR: %ENV_VAR% => %NX_ENV_VAR%
We are using nx.dev to build a set of apps and libraries for one of our clients.
Recently we found out that a CI/CD script we use to set the version number in the index.html file of the react apps was not working.
It simply appends a GET parameter to a static file that we’re loading – both to prevent cache and to know which build of the app we are currently running.
This is something we have in all our projects, but they are all using CRA (or CRACAO).
The issue with NX, turned out to be that environment variables are only replaced if they start with NX. E.g. %ENV_VAR% is not going to be replaced with the value of the environment variable, but %NX_ENV_VAR% is going to work just fine.