tl;dr: This is a walk-through for setting up a monorepo for react with a typescript module powered by lerna. If you don’t want to follow step-by-step you can also clone following repository and explore by yourself:

git clone https://github.com/jannikbuschke/lerna-react-typescript-samplecd lerna-react-typescript-sample
npm install
npm run bootstrap
npm run watch
npm run start (in a second terminal)

Now edit /packages/my-module/src/HelloWorld.tsx and see the update going live on http://localhost:3000

Now let’s start with the walk-through.

Install and initialize lerna

mkdir lerna-test
cd lerna-test
npm install lerna -g
lerna init

This creates a git repository, an empty packages folder for our apps and modules (a lerna convention…

Jannik Buschke

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store