My package.json has the following script:
"build": "sh -ac '. .env.${REACT_APP_ENV}; react-scripts build'"
When I run yarn build I get the following error: 
sh: .env.: No such file or directory
The .env file is in the top level of my project directory as expected. Any ideas?
You could also use the NODE_ENV variable, it gives you the environment mode.
I don't know if you're using create-react-app, but if you are (once you have built your app), you can use serve to run the production version:
$ npm install -g serve
$ serve -s build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With