This sample monorepo demonstrates the capability of using Lerna and Yarn Workspaces to set up a Create React App monorepo with CRACO. This project is configured to use TypeScript, ESLint, and Prettier.
The packages @namespace/app-one and @namespace/app-two are CRA apps, while @namespace/core is a collection of components that can be consumed by either app.
Lerna and Yarn are required.
npm i -g lerna yarn
git clone git@github.com:brammitch/monorepo.git
cd monorepo
yarn install
To get import suggestions from the @namespace/core package, it will need to be built.
yarn build:core
To start one of the apps, use the scripts in the root package.json.
yarn start:one
or yarn start:two
This will ensure that @namespace/core is compiled in watch mode, so any changes to @namespace/core or the app will trigger recompile/reload.