Even after moving to Yarn 4, switching branches and rebuilding Docker dev containers still spent too much time waiting on yarn install and fighting yarn link edits inside package.json and yarn.lock. Trying Bun as a drop-in local dev runner fixed both.

Speed and linking benchmarks

Here is how Bun compared against Yarn 4 in practice:

  • Cold install (empty cache): Yarn 4 took 3m 45s; Bun took 4m 31s.
  • Warm subsequent install: Yarn 4 took 2m 22s; Bun took 17s.

Bun's cold install takes ~1 minute longer while populating its global cache, and every install after that finishes in seconds, which makes running bun install automatically after git pull painless. Concurrent multi-service dev builds dropped from 8-10 minutes down to 1-3 minutes.

bun link is also much cleaner than yarn link: it symlinks the local folder directly without modifying package.json or yarn.lock, and handles workspaces cleanly. Just remember to link all local packages together in one shot (bun link pkg1 pkg2), since running bun install afterward resets the links.

The yarn.lock + resolutions gotcha

Running Bun inside dev containers while keeping yarn.lock as the shared team lockfile ran into two subtle traps:

  1. bun install --frozen-lockfile avoids creating a bun.lock, yet still checks consistency against package.json rather than honoring scoped resolutions the way Yarn does.
  2. Yarn scopes CVE resolutions to specific dependents when needed, whereas Bun applies top-level overrides globally, forcing major bumps (like minimatch v9 or ajv) onto older plugins that break on them.

Workaround: A small container startup script reads yarn.lock, pins direct dependencies and transitive overrides into a temporary container-only package.json, runs bun install --linker isolated --no-save, and restores package.json on exit (~96% exact version parity with yarn.lock without touching the host git tree).

Docker file-sharing bonus

With Docker Desktop synchronized file shares, excluding heavy local folders (.yarn, node_modules, .next) via .syncignore keeps container installs fast and keeps host and container caches separate.