Script in package.json to change environment
Pros and cons of changing the environment like this?
"scripts": {
"env-dev": "cp App/Config/index.dev.js App/Config/index.js",
"env-prod": "cp App/Config/index.production.js App/Config/index.js",
"env-staging": "cp App/Config/index.staging.js App/Config/index.js"
}
Those could even be named init-*, that way you run yarn run init-dev to get started. But at the same time I'm not sure it's worth writing a helper for such a small need, I'll let @AurelGit rule on that ^^
It's worth noting too that configuring for staging/production usually requires modifying the config file to set private keys/passwords, so the yarn run command alone would not be enough. It may be misleading to have a command for that if it doesn't do the whole job.
Thanks @DiogoAbu for the feedback !
Pros : running a script initializing the app is a very good idea Cons : only copy the file may not be sufficient in the future (running other tasks than copy a file)
But it could be very useful to add an init script running all necessary tasks.
@mnapoli, when you saids
It's worth noting too that configuring for staging/production usually requires modifying the config file to set private keys/passwords
On second thoughts, all your configuration variables in a mobile application should not be private (because builds in the phone) and so should be push in the repo. So copy seems to be enought.
all your configuration variables in a mobile application should not be private
right!
Iβm closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If itβs an enhancement and hasnβt been taken on for so long, then it seems no one has the time to implement this.
Please reopen if you still encounter this issue or need to implement this feature.
Thank you!