Skip to content

Commit

Permalink
Update lockfile.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Aug 20, 2023
1 parent 394dd86 commit 3c4b689
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/install/lockfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3c4b689

Please sign in to comment.