bun:bundle Runtime Resolution Problem
- Entity ID:
ent-20260420-dv14a0000py - Type:
concept - Scope:
shared - Status:
active - Aliases: bun:bundle import problem, bun:bundle runtime shim
Description
Architectural problem surfaced by the rebuild: the 'bun:bundle' module name is a build-time special that Bun's runtime does not natively resolve. Dev-mode execution therefore requires one of three workarounds: a bunfig.toml alias to src/shims/bun-bundle.ts, a Bun plugin registered via preload that intercepts /^bun:bundle$/ on resolve, or a pre-build transform that rewrites 'from bun:bundle' imports to the shim path.
Key claims
- bun:bundle cannot be imported at runtime without a shim hook
- Dev runner preloads shims before any CLI code runs
- Vitest config re-uses the bun:bundle shim path as its dev runner
Relations
- scripts/dev.ts Development Launcher --[informed_by]--> bun:bundle Runtime Resolution Problem
- bunfig.toml preload + alias Configuration --[informed_by]--> bun:bundle Runtime Resolution Problem
- Vitest Test Infrastructure --[depends_on]--> bun:bundle Runtime Resolution Problem