drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

Use Rolldown for builds

Open L-Mario564 opened this issue 2 months ago • 0 comments

This PR aims to migrate from using tsup and Rollup to using Rolldown.

  • All packages are now built using Rolldown and for any additional build steps they have in common, those functions are present in the top-level build folder.
  • Replace recast with oxc-parser and magic-string while also parallelizing the task to fix CJS imports. This leads to some performance gains, around 1-2 seconds faster for smaller packages or up to 2x-3x faster for larger packages like drizzle-orm.
  • Use Bun instead of zx, cpy and tsx.
  • The dist output for the validator packages and drizzle-seed are practically identical due to the Rolldown API being highly compatible with Rollup.
  • drizzle-orm's dist output is different from the one produced by tsup. It should work for both CJS and ESM. If any entrypoints are missing they can be added in the rolldown.config.ts file.
  • drizzle-kit's dist output is also different. The dev build script was already erroring when I began working on this migration so I tried my best to migrate that. The regular build, CLI build and external build should work as expected.
  • Fixed some minor issues related to stripping internal exports.

L-Mario564 avatar Oct 27 '25 17:10 L-Mario564