![]() In a workspace in the Expo repo, specify "_generated_/AppEntry.js" as the value of the "main" field in package.json. In a conventional Expo app, the value of the "main" field is node_modules/expo/AppEntry.js. The postinstall script determines the location of the generated entry module by looking at the "main" field in package.json. This is similar to conventional Expo apps, but we need to generate a different entry module because Metro does not use the logical path to the entry module within the symlinked expo package.ĭefine the entry module in the "main" field of each app's package.json It generates an entry module for the app that assumes your app's root component is exported from App.js ( App.$.js also works). These symlinks point to the respective packages installed in the workspace root. It creates symlinks for packages that some programs expect to exist under node_modules, namely expo and react-native. Add a postinstall script to each app's package.jsonĪdd "postinstall": "expo-yarn-workspaces postinstall" under the "scripts" object in each app's package.json file. This adds scripts provided by expo-yarn-workspaces to the project under its node_modules/.bin directory and also defines modules the app will use. ![]() Run yarn add -dev expo-yarn-workspaces in each app. ![]() Add expo-yarn-workspaces as a devDependency of each app workspace All of the steps are important and need to be followed carefully. How apps work with workspacesĮach Expo app in the repository that is intended to work with Yarn workspaces (as opposed to being tested in a non-workspace environment) does the steps described below. Note: This package runs only on macOS and Linux. ![]() It finesses Yarn workspaces, Metro, and the Expo repository to work together. This is a package that provides support for Yarn workspaces within monorepos like the Expo repository. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |