pnpm -r, --recursive
Aliases: m, multi, recursive, <command> -r
次のコマンドと一緒に使用すると、ワークスペースのすべてのプロジェクトでコマンドを実行します。
installlistoutdatedpublishrebuildremoveunlinkupdatewhy
次のコマンドと一緒に使用すると、ルートプロジェクトを除く、ワークスペースの各プロジェクトでコマンドを実行します。
execruntestadd
If you want the root project be included even when running scripts, set the include-workspace-root setting to true.
使用例:
pnpm -r publish
Options
--link-workspace-packages
- Default: false
- Type: true, false, deep
Link locally available packages in workspaces of a monorepo into node_modules
instead of re-downloading them from the registry. This emulates functionality
similar to yarn workspaces.
これを deep に設定すると、ローカルパッケージも subdependencies にリンクできるようになります。
Be advised that it is encouraged instead to use npmrc for this setting, to enforce the same behaviour in all environments. このオプションは単独で存在するので、必要であれば上書きしてください。
--workspace-concurrency
- Default: 4
- Type: Number
同時に実行するタスクの最大数を設定します。 For unlimited concurrency
use Infinity.
You can set the workspace-concurrency as <= 0 and it will use amount of cores of the host as: max(1, (number of cores) - abs(workspace-concurrency))
--[no-]bail
- Default: true
- Type: Boolean
true の場合、タスクがエラーを投げると停止します。
このオプションは、終了コードには影響しません。
Even if --no-bail is used, all tasks will finish but if any of the tasks fail,
the command will exit with a non-zero code.
例 (すべてのパッケージでテストを実行し、そのうちの1つでテストが失敗した場合は続行する)
pnpm -r --no-bail test
--[no-]sort
- Default: true
- Type: Boolean
When true, packages are sorted topologically (dependencies before dependents).
Pass --no-sort to disable.
例:
pnpm -r --no-sort test
--reverse
- Default: false
- Type: boolean
When true, the order of packages is reversed.
pnpm -r --reverse run clean