filiphosko
filiphosko

Reputation: 303

React Native: ignore files in a CodePush update

My use case is that I have an env file and its contents are replaced each time I build the app through Appcenter with environment variables. I fear that when I update the file locally (for example add another variable), the file would be overwritten in next CodePush release (so basically the build from Appcenter after the vars are replaced will have different contents of this file in comparison with what CodePush will see). Is this the correct assumption? If it is, is there a way to exclude certain files from a CodePush update? Thanks.

Upvotes: 1

Views: 1079

Answers (1)

bmovement
bmovement

Reputation: 867

I'm using react-native-config, and it seems to bake the config values into the binary at compile-time, and they don't get overridden via the Code Push bundle.

If you're not using that, or just want to see what the Code Push bundle includes, use the CLI's code-push release-react like you normally would. But once the bundle starts to upload, kill the process, preventing the upload. In your project folder, there will be a newly-created zip file containing the files that were going to be uploaded as part of the release. Unzip it and take a look to find out what's included, and trash it when you're done.

Upvotes: 1

Related Questions