aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-08-19 19:07:26 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-08-19 19:08:17 -0700
commit3c4b689050e94e0685305f876a945e3c9fa04ad9 (patch)
tree4a989083c6efe6095bab83cbdc3c62318b8d8892 /docs
parent394dd8679763ffed60e1462af097f007d191a1b6 (diff)
downloadbun-3c4b689050e94e0685305f876a945e3c9fa04ad9.tar.gz
bun-3c4b689050e94e0685305f876a945e3c9fa04ad9.tar.zst
bun-3c4b689050e94e0685305f876a945e3c9fa04ad9.zip
Update lockfile.md
Diffstat (limited to 'docs')
-rw-r--r--docs/install/lockfile.md30
1 files changed, 29 insertions, 1 deletions
diff --git a/docs/install/lockfile.md b/docs/install/lockfile.md
index 4ae9025ff..3a5a73e82 100644
--- a/docs/install/lockfile.md
+++ b/docs/install/lockfile.md
@@ -4,10 +4,38 @@ Running `bun install` will create a binary lockfile called `bun.lockb`.
In a word: Performance. Bun’s lockfile saves & loads incredibly quickly, and saves a lot more data than what is typically inside lockfiles.
-#### How do I inspect it?
+#### How do I inspect the lockfile?
Run `bun install -y` to generate a Yarn-compatible `yarn.lock` (v1) that can be inspected more easily.
+#### How do I `git diff` the lockfile?
+
+To add to the global gitattributes file:
+
+- First try `$XDG_CONFIG_HOME/git/attributes`
+- If `$XDG_CONFIG_HOME` is not set, try `~/.config/git/attributes`
+
+For example, on macOS, add the following to `~/.config/git/attributes`:
+
+```
+*.lockb diff=lockb
+```
+
+Then add the following to `~/.gitconfig`:
+
+```
+[diff "lockb"]
+ textconv = bun
+ binary = true
+```
+
+To only add to the local gitattributes file:
+
+```
+$ git config diff.lockb.textconv bun
+$ git config diff.lockb.binary true
+```
+
#### Platform-specific dependencies?
Bun stores normalized `cpu` and `os` values from npm in the lockfile, along with the resolved packages. It skips downloading, extracting, and installing packages disabled for the current target at runtime. This means the lockfile won’t change between platforms/architectures even if the packages ultimately installed do change.