pnpm -r, --recursive
別名: 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
オプション
--link-workspace-packages
- デフォルト: false
- タイプ: true, false, deep
レジストリから再ダウンロードする代わりに、ローカルで利用可能なmonorepoのワークスペースのパッケージを node_modules にリンクします。 これは、yarn workspace の機能を再現したものです。
これを 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
- デフォルト: 4
- タイプ: Number
同時に実行するタスクの最大数を設定します。 無制限にする場合は 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
- デフォルト: true
- タイプ: Boolean
true の場合、タスクがエラーを投げると停止します。
このオプションは、終了コードには影響しません。 --no-bail が使われていても、すべてのタスクは終了しますが、いずれかのタスクが失敗すると、0以外のコードでコマンドが終了します。
例 (すべてのパッケージでテストを実行し、そのうちの1つでテストが失敗した場合は続行する)
pnpm -r --no-bail test
--[no-]sort
- デフォルト: true
- タイプ: Boolean
true の場合、パッケージはトポロジカルソートに従ってソートされます(依存元の前に依存先)。 無効にするには --no-sort を使用します。
例:
pnpm -r --no-sort test
--reverse
- デフォルト: false
- タイプ: boolean
true の場合、パッケージのソート順が逆になります。
pnpm -r --reverse run clean