Skip to content

fix(build): accept splitting in buildOptions - #40

Merged
LibirSoft merged 1 commit into
masterfrom
docs/build-splitting-option
Nov 1, 2026
Merged

LibirSoft merged 1 commit into
masterfrom
docs/build-splitting-option

Conversation

@LibirSoft

Copy link
Copy Markdown
Member

asena build already passes buildOptions through to Bun.build, so splitting: true works at runtime, but the BuildOptions type did not list it and asena.config.ts failed to typecheck with it.

This adds splitting to the picked Bun.BuildConfig keys. The default stays off. The Website will document the option once this is released.

With splitting: true, dynamically imported code (for example the database driver @asenajs/asena-drizzle loads for the configured type) goes into chunk files next to index.asena.js instead of being inlined. In a minimal bun-sql app the entry file went from 1.67 MB to 91 KB and startup from 51 ms to 45 ms.

Typecheck and prettier are clean; patch changeset included.

@LibirSoft
LibirSoft merged commit 31c4d8c into master Nov 1, 2026
1 check passed
@LibirSoft
LibirSoft deleted the docs/build-splitting-option branch November 1, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant