跳到主内容
版本:Next

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>

指定自定义压缩级别。

--json

JSON 格式的日志输出。

--filter <package_selector>

Added in: v10.11.0

阅读更多有关过滤的内容。

生命周期

  • prepack
  • prepare
  • postpack