Prioritize build order with yarn workspaces and lerna
There is no prioritization in lerna
so far.
Although here's what I do in several projects at the moment:
"scripts": { ... "build": "lerna run build --ignore=libs-*", "prebuild": "lerna run build --scope=libs-*" ...}
Note: prebuild
will run automatically so you don't need to call it explicitly
One caveat here is you need to prefix all Libs
package names with either something like libs-module-name
as the example above or maybe a scope like @my-org-libs/module-name
and call them with @my-org-libs/*
instead.
Another solution would be calling each Libs
package explicitly with multiple --scope=package-name --scope=package-name-2
parameter in prebuild
. But that might get quickly ugly if you have many modules under Libs
.