In addition to generating the native folders, prebuild also makes the following modifications: Work is in progress to eliminate these side effects - ideally, running npx expo prebuild would generate the iOS and Android projects and leave the rest of the project untouched. Side effectsĪs of SDK 46, npx expo prebuild performs several side effects outside of generating the android and ios directories. This is not generally recommended because the base modifiers in make some undocumented assumptions about the template files, so it may be tricky to maintain your custom template. You can change the template used by passing -template /path/to/template.tgz to the npx expo prebuild command. The template files are based on the Expo SDK version and come from the npm package expo-template-bare-minimum. Prebuild generates template files before modifying them with config plugins. You can see a list of some popular plugins for more information. Many config plugins already exist for lots of modifications. You can customize how the native folders are generated while remaining in the managed workflow by building config plugins. For example, you may want to build custom functionality natively in Xcode and Android Studio, and then move that functionality into local config plugins. There are cases where developers may want to swap between workflows often. However, this can make custom config plugins harder to develop so we haven't introduced any mechanism to enforce this behavior. gitignore, ensuring that the project is always managed. The purpose of the prompt is to encourage managed workflow users to add the android and ios directories to the project's. If you'd like, you can disable the check by enabling the environment variable EXPO_NO_GIT_STATUS=1. This prompt is optional and will be skipped when encountered in CI. This is why using the -clean flag is the safest way to use the prebuild command and it is generally recommended in most cases.ĭue to the destructive nature of the flag, you'll be warned to have a clean git status when the -clean flag is used. For example, not all config plugins are idempotent - when your project utilizes a lot of "dangerous modifiers" for performing changes like adding regex changes to application code, this can sometimes lead to unexpected behavior. This is faster than re-generating from scratch, but it may not produce the same results in some cases. When you re-run npx expo prebuild without the -clean flag, it layers the changes on top of your existing files. The -clean flag will delete any existing native directories before generating. You can force a specific package manager by providing one of: -npm, -yarn, -pnpm.Īll installations can be skipped by passing the -no-install command, which is useful for testing generation quickly. When the dependencies are changed, prebuild will reinstall packages using the package manager that is currently used in the project (this is inferred from the lockfile). npx expo prebuild -skip-dependency-update react-native,react Package managers
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |