我在一个单一存储库中有这个大型打字稿项目,使用yarn workspaces
并lerna
具有以下架构:
repo
├── API
│ └── (GraphQL API)
├── Apps
│ └── (Front-end React Apps)
├── Libs
│ └── (Shared libraries)
└── Services
└── (Back-end Services)
我package.json
看起来像:
{
...
"workspaces": [
"API/**/*",
"Apps/**/*",
"Libs/**/*",
"Services/**/*",
],
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna run build"
}
...
}
我的lerna.json
样子:
{
"lerna": "2.11.0",
"npmClient": "yarn",
"useWorkspaces": true,
"workspaces": [
"Libs/**/*",
"API/**/*",
"Apps/**/*",
"Services/**/*"
],
"version": "1.0.0"
}
现在我需要Libs
在两者之前构建所有共享Apps
,Services
因为它们对它有依赖关系。但是当我运行yarn build
并触发它时lerna run build
,它似乎build
以随机(?)顺序触发了该过程,因此它无法构建,因为库“还不存在”。
有没有办法设置如何lerna
触发构建的顺序?