You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/install/lockfile.md
+18
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,24 @@ $ bun install --yarn
72
72
print = "yarn"
73
73
```
74
74
75
+
### Text-based lockfile
76
+
77
+
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at [no cost to performance](https://bun.sh/blog/bun-lock-text-lockfile#cached-bun-install-gets-30-faster).
78
+
79
+
To generate the lockfile, use `--save-text-lockfile` with `bun install`. You can do this for new projects and existing projects already using `bun.lockb` (resolutions will be preserved).
80
+
81
+
```bash
82
+
$ bun install --save-text-lockfile
83
+
$ head -n3 bun.lock
84
+
{
85
+
"lockfileVersion": 0,
86
+
"workspaces": {
87
+
```
88
+
89
+
Once `bun.lock` is generated, Bun will use it for all subsequent installs and updates through commands that read and modify the lockfile. If both lockfiles exist, `bun.lock` will be choosen over `bun.lockb`.
90
+
91
+
Bun v1.2.0 will switch the default lockfile format to `bun.lock`.
Copy file name to clipboardexpand all lines: docs/runtime/bunfig.md
+11
Original file line number
Diff line number
Diff line change
@@ -238,6 +238,17 @@ By default Bun uses caret ranges; if the `latest` version of a package is `2.4.1
238
238
exact = false
239
239
```
240
240
241
+
### `install.saveTextLockfile`
242
+
243
+
Generate `bun.lock`, a human-readable text-based lockfile. Once generated, Bun will use this file instead of `bun.lockb`, choosing it over the binary lockfile if both are present.
244
+
245
+
Default `false`. In Bun v1.2.0 the default lockfile format will change to `bun.lock`.
0 commit comments