0

In Yarn 1, yarn workspaces run build would use the order specified in the workspaces field of the package.json file to build each package.

For example, if I had the order specified like this:

"workspaces": {
  "packages" [
    "packages/c",
    "packages/b",

Then packages/c would be built before packages/b.

In Yarn 3, packages/b is being built before packages/c which won't work as I need packages/c to be built before everything else.

Is there a way around this?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
dagda1
  • 26,856
  • 59
  • 237
  • 450

1 Answers1

0

Start by including the workspace-tools yarn plugin:

yarn plugin import workspace-tools

After doing that you should be able to do:

yarn workspaces foreach -pRt run build

Which should give you the behavior you want parallelizing builds where it can.

Josh C.
  • 370
  • 2
  • 8