drizzle-team / drizzle-team/drizzle-orm
`drizzle-kit` architectural weight: Move build/runtime-eval tools (`tsx`, `esbuild`) out of `production` dependencies
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Description
Currently, `drizzle-kit` (tested on `v1.0.0-rc.3`) includes heavy build and execution tools directly in its `dependencies`:
- `"@esbuild-kit/esm-loader": "^2.5.5"`
- `"esbuild": "^0.25.4"`
- `"tsx": "^4.21.0"`
While these tools are necessary for `drizzle-kit` to execute and parse TypeScript configuration files (`drizzle.config.ts`) and schemas on the fly, keeping them in production `dependencies` significantly bloats the `node_modules` of any project incorporating Drizzle, increasing installation times and disk usage.
### Proposed Solutions
1. **Bundle the CLI:** Bundle `drizzle-kit` before publishing to npm (using `tsup`, `esbuild`, or `ncc`) so that internal execution helpers are tree-shaken and compiled into the distribution files, eliminating the need to ship heavy external dependencies like full `esbuild` or `tsx` binaries to the end-user.
2. **Optional/Peer Dependencies:** Move these execution engines to `optionalDependencies` or `peerDependencies` with a fallback warning if a user tries to run the CLI without them (or if they prefer to use their own runtime like `bun` or `vitest/execute`).
### Additional Context
For CI/CD pipelines and monorepos, reducing the dependency tree footprint of CLI tools drastically improves bootstrap speed.
Contributor guide
Assessment
This issue has not been assessed yet.