I want to avoid downgrading my dependencies during expo prebuild.
In my repository, I have set "postinstall": "expo prebuild --skip-dependency-update expo,expo-updates,react-native,react-native-unimodules" which runs prebuild first.
expo run checks if the ios and android folders are there and does not run prebuild again if thats the case. But eas build does not do the same check and always runs expo prebuild again, downgrading my dependencies. (The check for eas build seems to be whether android and ios folders are gitignored, which they are in my case)
Is it possible to disable the downgrade behavior? For example by specifying the arguments passed to expo prebuild during eas builds? (–skip-dependency-update in particular)
for eas only file that are commited into repo matter(only git repo is uploaded to the builder), so from build service perspective project like that is managed one and we are enforcing specific package versions.
If you have good reason to override and you are prepared to deal with potential issue that his might cause you can force that behaviour by either
committing android and ios directory
build with EAS_NO_VCS=1 eas build - this will ignore git fully, but careful this disables all git functionality (you won’t have warning about uncommitted changes, commit hash will be missing on the website, if cli is introducing any changes we can’t display you diff of that)
Even with EAS_NO_VCS=1 eas-cli’s resolveWorkflowAsync function still calls git check-ignore on AndroidManifest.xml / project.pbxproj and if they are gitignored, it sets the workflow to MANAGED which causes prebuild to be executed.
I can confirm that the android and ios folders are included in the bundle uploaded to EAS. In expo run, the existence of android and ios folders is what triggers prebuiild, in EAS Build, expo seems to just use the detected project type (managed / generic) which is based on the existence of native files and the corresponding gitignore config.
I wish there were one of these features:
a) expo prebuild should not downgrade dependencies
b) eas build runner should use the same logic as expo run for executing expo-prebuild: existence of ios and android folders
c) EXPO_PREBUILD_ARGS, EXPO_PREBUILD_SKIP_DEPENDENCY_UPDATE or eas.json / app.json config to set the arguments for prebuild
Even with EAS_NO_VCS=1 eas-cli’s resolveWorkflowAsync function still calls git check-ignore on
with that option, no git command should be called
I can confirm that the android and ios folders are included in the bundle uploaded to EAS
how did you verify this? bigger upload size is not 100% correct indicator
I forgot that we still respect .gitignore even with that option, if you want to upload android and ios dirs you also need to copy your .gitignore file to .easignore and remove android and ios from there
But honestly, having an escape hatch via a CLI, eas.json or app.json parameter would be great!
It would be even better if no packages were autoinstalled and instead expo doctor would warn if there is a mismatch.