An Expo Config Plugin that generates native Apple Targets like Widgets or App Clips, and links them outside the /ios directory. You can open Xcode and develop the targets inside the virtual expo:targets folder and the changes will be saved outside of the ios directory. This pattern enables building things that fall outside of the scope of React Native while still obtaining all the benefits of Continuous Native Generation.
This plugin requires at least CocoaPods 1.16.2 (ruby 3.2.0), Xcode 16 (macOS 15 Sequoia), and Expo SDK +53.
- Run
npx create-targetin your Expo project to generate an Apple target. - Select a target to generate, I recommend starting with a
widget(e.g.npx create-target widget). This will generate the required widget files in the root/targetsdirectory, install@bacons/apple-targets, and add the Expo Config Plugin to your project. - If you already know your Apple Team ID, then set it under the
ios.appleTeamIdproperty in yourapp.json. You can find this in Xcode under the Signing & Capabilities tab and set it later if needed. - Run
npx expo prebuild -p ios --cleanto generate the Xcode project. - You can now open your project in Xcode (
xed ios) and develop the widget inside theexpo:targets/<target>folder. - When you're ready to build, select the target in Xcode and build it.
The root /targets folder is magic, each sub-directory should have a expo-target.config.js file that defines the target settings. When you run npx expo prebuild --clean, the plugin will generate the Xcode project and link the target files to the project. The plugin will also generate an Info.plist file if one doesn't exist.
The Config Plugin will link the subfolder (e.g. targets/widget) to Xcode, and all files inside of it will be part of the target. This means you can develop the target inside the expo:targets folder and the changes will be saved outside of the generated ios directory.
The root Info.plist file in each target directory is not managed and can be freely modified.