Перейти к основному содержимому
Version: 5.x

pnpm publish

Публикует пакет в реестр.

pnpm [-r] publish [<tarball|folder>] [--tag <tag>]
[--access <public|restricted>]

When publishing a package inside a workspace, the LICENSE file from the root of the workspace is packed with the package (unless the package has a license of its own).

You may override some fields before publish, using the publishConfig field in package.json.

When running this command recursively (pnpm -r publish), pnpm will publish all the packages that have versions not yet published to the registry.

Опции

--tag <тег>

Publishes the package with the given tag. By default, pnpm publish updates the latest tag.

Например:

# inside the foo package directory
pnpm publish --tag next
# in a project where you want to use the next version of foo
pnpm add foo@next

--access <public|restricted>

Tells the registry whether the published package should be public or restricted.

git-checks

Добавлено в: v4.11.0

  • По умолчанию: true (начиная с v5)
  • Тип: Boolean

When true, pnpm publish checks if the current branch is your publish branch (master by default), clean, and up-to-date.

publish-branch

Добавлено в: v4.11.0

  • По умолчанию: master
  • Тип: String

The primary branch of the repository which is used for publishing the latest changes.

--force

Добавлено в: v5.18.0

Try to publish packages even if their current version is already found in the registry.

--filter <селектор пакета>

Добавлено в: 4.6.0

Подробнее о фильтрации.