pnpmpnpm-workspace

How to control pnpm workspace build order


I'm working in a large pnpm monorepo (pnpm v7).

The repository contains :

Every package (app or shared library) may reference any shared library (no circular ref though)

The compilation setup package is gulp helper that setup the compilation tasks for each app and some shared components.

It means that the build order should be :

Although dependencies are declared in every package.json files properly (either as devDependency or dependency), runnin pnpm -r run build seems to build projects randomly. The result is that it doesn't compile (complaining it miss some dependent packages).

I thought pnpm is supposed to deal with build order. Is there anything I miss ?

Should I move to more complex tools like turborepo or rush?


Solution

  • I think, finally, that pnpm is not able, alone, to have such control.

    I solved my issue by addin new tool on top of my repo.

    I first gave a chance to turbo then nxdev. Both are able to detect the dependency graph and build in the correct order