yarn pack — Yarn CLI reference

Pack the project into a distributable archive

Docs/Reference/CLI/pack

yarn pack

Pack the project into a distributable archive

yarn pack

This command turns the active workspace into a compressed archive suitable for publishing. By default the archive is written to package.tgz at the workspace root.

If --out is set, the archive is written to the specified path. The %s and %v placeholders are replaced by the package name and version.

#--dry-run, -nboolean

Print the files that would be included without generating the archive

#--install-if-neededboolean

Run yarn install first when the package needs build scripts

#--preserve-workspacesboolean

Keep workspace: ranges unchanged in the generated package manifest

#--jsonboolean

Format the output as an NDJSON stream

#--outboolean

Path where the archive should be written