Skip to content

fix(drizzle): lazy load drizzle-kit to prevent production bundling#17009

Open
deepshekhardas wants to merge 1 commit into
payloadcms:mainfrom
deepshekhardas:fix/lazy-load-drizzle-kit
Open

fix(drizzle): lazy load drizzle-kit to prevent production bundling#17009
deepshekhardas wants to merge 1 commit into
payloadcms:mainfrom
deepshekhardas:fix/lazy-load-drizzle-kit

Conversation

@deepshekhardas

Copy link
Copy Markdown
Contributor

drizzle-kit/api was being required at module load time, causing it to be included in production bundle for OpenNext Cloudflare and other edge runtimes.

Moves the require() inside the function so it's only loaded when actually needed (during migrations/schema push). Also fixes the same issue in postgres adapter.

Closes #16470

drizzle-kit/api was being required at module load time, causing it
to be included in production bundle for OpenNext Cloudflare and
other edge runtimes.

This moves the require() inside the function so it's only loaded
when actually needed (during migrations/schema push).

Also fixes the same issue in postgres adapter.

Fixes: payloadcms#16470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

db-sqlite is pulling drizzle-kit/api into OpenNext Cloudflare output

1 participant