Git との連携

ロックファイル#

You should always commit the lockfile (pnpm-lock.yaml). 主な理由は次のとおりです。

  • パッケージ解決をスキップできるため、CI環境や本番環境でのインストールが短時間で済むようになります。
  • 開発、テスト、本番のそれぞれの環境でインストールするパッケージの一貫性を保証します。開発作業をしているときと全く同じバージョンのパッケージを、テスト環境や本番環境で使用できるのです。

マージの競合#

pnpm can automatically resolve merge conflicts in pnpm-lock.yaml. If you have conflicts, run pnpm install and commit the changes.

If both sides of the conflict are valid lockfiles, pnpm merges them. Otherwise it fails with the parse error. Review the result before committing.

To avoid lockfile merge conflicts, use Git branch lockfiles.