$ git clone https://github.com/stephenhandley/expoyarnlerna
$ cd expoyarnlerna
$ yarn
$ yarn bootstrap
$ yarn build
$ yarn start:app
- Setup new project with Lerna
- Create Expo app in
packages/app
- Create shared package in
packages/shared
- Follow process described here to enable Yarn workspaces within Expo app
- Add babel deps to top level package in order to build shared directories
yarn add --dev -W @babel/cli @babel/core @babel/preset-react @babel/preset-env babel-preset-expo babel-loader webpack
Without this you'll see your Expo app barf on JSX, etc.
Module parse failed: Unexpected token (4:9)
You may need an appropriate loader to handle this file type.
- Make
package.json
andbabel.config.js
files parallel the ones here
First three steps are pretty straightforward, but make sure you follow step 4 closely. After that step, you can verify the package import is working by exporting something not requiring babel and importing that into the Expo app package and verifying everything renders ok.
Steps 5 and 6 are adapted from this repo. If you're having issues with getting babel working, there's an associated blog post walking through that setup in more detail in addition to getting Jest testing and Storybooks setup.
Expo 34.0.1
Lerna 3.16.4
Yarn 1.12.3