pnpm pack
パッケージのtarballを作成します。
引数
--recursive, -r
Added in: v10.11.0
Pack all packages from the workspace.
--out <path>
Customizes the output path for the tarball. Use %s and %v to include the package name and version, e.g., %s.tgz or some-dir/%s-%v.tgz. By default, the tarball is saved in the current working directory with the name <package-name>-<version>.tgz.
--pack-destination <dir>
pnpm packがtarballを保存するディレクトリを指定します。 初期値は現在の作業ディレクトリです。
--pack-gzip-level <level>
Specifying custom compression level.
--json
ログを JSON 形式で出力します。
--filter <package_selector>
Added in: v10.11.0
詳細についてはフィルタリングに関するドキュメントを参照してください。
--dry-run
Added in: v10.26.0
Does everything a normal run does, except actually packing the tarball. Useful for verifying the contents of the tarball.
ライフサイクルスクリプト
prepackpreparepostpack
You can also use the beforePacking hook to programmatically modify the package.json contents before the tarball is created. This is useful for removing development-only fields or adding publication metadata without modifying your local package.json.