brammitch / monorepo

Sample create-react-app monorepo with craco.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

monorepo

About

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.

Setup

Prerequisites

Lerna and Yarn are required.

npm i -g lerna yarn

Clone repo

git clone git@github.com:brammitch/monorepo.git

Installation

cd monorepo

yarn install

VSCode Import Suggestions

To get import suggestions from the @namespace/core package, it will need to be built.

yarn build:core

Running

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.

References

About

Sample create-react-app monorepo with craco.


Languages

Language:JavaScript 39.4%Language:TypeScript 33.2%Language:HTML 17.8%Language:CSS 9.6%