pnpm -r, --recursive
Aliases: m, multi, recursive, <command> -r
次のコマンドと一緒に使用すると、ワークスペースのすべてのプロジェクトでコマンドを実行します。
installlistoutdatedpublishpackrebuildremoveunlinkupdatewhy
次のコマンドと一緒に使用すると、ルートプロジェクトを除く、ワークスペースの各プロジェクトでコマンドを実行します。
execruntestadd
If you want the root project be included even when running scripts, set the includeWorkspaceRoot setting to true.
使用例:
pnpm -r publish
By default, recursive run, exec, and test execute projects in
topological order: dependencies run before their dependents. Use --no-sort
to disable graph ordering, or --parallel to start tasks without waiting for
dependencies.
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 pnpm-workspace.yaml for this setting, to
enforce the same behaviour in all environments. このオプションは単独で存在するので、必要であれば上書きしてください。
--workspace-concurrency#
- Default: the smaller of 4 and the number of available CPU cores
- Type: Number
同時に実行するタスクの最大数を設定します。 For unlimited concurrency
use Infinity.
In a container with a CPU quota, such as a Kubernetes CPU limit, the quota is the number of available CPU cores when it is smaller than the number of CPUs the container may run on. A fractional quota is rounded down, to at least 1.
You can set the workspace-concurrency as <= 0 and it will use the number of available CPU cores as: max(1, (number of available CPU cores) - abs(workspace-concurrency))
--[no-]bail#
- Default: true
- Type: Boolean
true の場合、タスクがエラーを投げると停止します。
With --no-bail, tasks that depend on a failed task are skipped and independent tasks keep running.
This config does not affect the exit code: if any task fails, the command exits with a non-zero code.
See --no-bail.
例 (すべてのパッケージでテストを実行し、そのうちの1つでテストが失敗した場合は続行する)
pnpm -r --no-bail test
--[no-]sort#
- Default: true
- Type: Boolean
When true, commands follow the workspace dependency graph. Recursive run
also applies relationships from the tasks setting. Pass --no-sort to
remove graph ordering. This also makes tasks, --reverse, and --resume-from
inapplicable.
例:
pnpm -r --no-sort test
--reverse#
- Default: false
- Type: boolean
When true, dependency edges are reversed. For recursive run, this reverses
the resolved task graph, including relationships declared with dependsOn.
pnpm -r --reverse run clean