pnpm pack

Crea un comprimido (tarball) a partir de un paquete.

Opciones#

--recursive, -r#

Agregado en: 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>#

El directorio en el que pnpm pack guardará los comprimidos. El predeterminado es el directorio de trabajo actual.

--pack-gzip-level <nivel>#

Especificando el nivel de compresión personalizado.

--json#

El registro aparecerá en formato JSON.

--filter <package_selector>#

Agregado en: v10.11.0

Leer más acerca del filtrado.

--dry-run#

Agregado en: v10.26.0

Does everything a normal run does, except actually packing the tarball. Useful for verifying the contents of the tarball.

--skip-manifest-obfuscation#

Agregado en: v11.3.0

Keep the original packageManager field and publish lifecycle scripts in the packed manifest instead of stripping them. The pnpm-specific pnpm field is still omitted.

Scripts del ciclo de vida#

  • prepack
  • prepare
  • postpack

tip

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.