Switch language한국어
Back to the list

Using Bun Better with Nx: Migration from Nx 18 to 21

TL;DR AI

Key summary

2 min read
  1. Nx added official Bun support and improved bun.lock parsing in specific versions, nx 19.5 introduced official Bun support; Nx 21.4+ improved bun.lock parsing.

  2. Bun switched lock file format from binary bun.lockb to text bun.lock in Bun 1.2.x, bun 1.2.x changed lock file from bun.lockb to bun.lock (text/JSONC).

  3. Project repository Nx 18.x detects package manager based on existing lock files and prioritized yarn.lock over bun.lockb presence of yarn.lock led Nx 18.x to detect Yarn as package manager.

  4. Migration process temporarily removed yarn.lock to let nx migrate use npm fallback and proceed to upgrade Nx removed yarn.lock temporarily to allow nx migrate to proceed.

  5. Webpack build generatePackageJson:true with bun.lockb caused webpack build to fail due to missing External Node metadata parsing @nx/webpack with generatePackageJson:true and bun.lockb caused HookWebpackError related to External Node metadata.

Read the original