Integrating Turborepo instead of or with Lerna
So far, we’ve seen quite a variety of tools in this chapter. While the workspaces feature of modern npm clients is already more than sufficient for smaller monorepos, larger ones require more dedicated tools to be manageable. In cases where Lerna is a bit too simplistic and Rush is too opinionated, another alternative exists – Turborepo, or Turbo for short. It can be seen as a replacement for or an addition to Lerna.
Starting from scratch is rather easy – Turbo comes with an npm initializer:
$ npm init turbo
This will open a command-line survey and scaffold the directory with some sample code. In the end, you should see a couple of new files being created, such as a turbo.json
or a package.json
file. Furthermore, Turbo creates apps
and packages
directories containing some sample code.
Let’s show the strength of Turbo by running the build
script:
$ npx turbo run build
In contrast to Lerna, this...