An example of a split project into separate packages, useful for code sharing, using Lerna.
See live example
- it uses lerna and yarn as npm client.
- it has 2 packages: the web app (Next.js) and an ui-lib, both using TypeScript (in the
packagesfolder). - the modules from the ui-lib are being transpiled into the Next.js app with next-transpiled-modules.
- to have yarn installed. (
npm install -g yarn) - to have lerna installed. (
npm install -g lerna)
- clone the repository
lerna bootstrapyarn start:app- good to go 🤪
When you are creating the project, at the Configure Project select:
- Framework preset:
Next.js - Root Directory:
./packages/web-app