Change your app.json to base-app.json and untrack the original file in your .gitignore
Then add something like
"generateConfig": "rimraf app.json && node generateConfig"
to your package.json
scripts, and yarn generateConfig && react-native-scripts start
to scripts like "start" or any others that may need app.json generated.
@joelbowen liking it so far!
Mine here: https://gist.github.com/andrewsantarin/699da98a6082d8f413a5e060092f35f6, which itself is a heavily modified react-scripts/config/env.js adapted with your code.
However, I'm at a loss as to how I can allow things like
.env.${NODE_ENV}.${isLocal ? 'local' : ''}
because theNODE_ENV
seems to only be assigned until after Expo has loaded, which is responsible for setting the app env.