drizzle-orm
drizzle-orm copied to clipboard
Use Rolldown for builds
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
buildfolder. - Replace
recastwithoxc-parserandmagic-stringwhile 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 likedrizzle-orm. - Use Bun instead of
zx,cpyandtsx. - The
distoutput for the validator packages and drizzle-seed are practically identical due to the Rolldown API being highly compatible with Rollup. - drizzle-orm's
distoutput 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 therolldown.config.tsfile. - drizzle-kit's
distoutput 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.