Use Yarn Workspaces to Share Code with a create-react-app and create-react-native-app in a Monorepo

Jason Brown
Code Daily
Published in
1 min readFeb 28, 2018

--

In this lesson we’ll use yarn and yarn workspaces to create a monorepo that includes a web creat-react-app, a react-native app, and shared code. We’ll use react-app-rewired and react-app-rewire-babel-loader to rewire the create-react-app configuration to allow babel to process the shared code from workspace. We'll also use crna-make-symlinks-for-yarn-workspaces and metro-bundler-config-yarn-workspaces to configure the react-native app to be able to find the shared code in the workspaces.

Originally published at codedaily.io on February 28, 2018.

Closing Notes:

I publish articles and screencasts weekly on React, React Native, and everything else related to web development. Be sure and follow me on Twitter.

Join our Newsletter to get the latest and greatest content to make you a better developer.

Check out my course and you too can master React Native Animations! Use the coupon code: codedaily for 60% off!

If this post was helpful, please click the clap 👏 button below a few times to show your support! ⬇⬇

--

--