Bun-Specific API Stubs
- Entity ID:
ent-20260420-b01a00000014 - Type:
pattern - Scope:
shared - Status:
active - Aliases: Bun.hash stub, Bun.file stub, src/shims bun-api shims
Description
Compatibility stubs under src/shims/ replacing Bun-native APIs (e.g. Bun.hash, Bun.file) with Node-compatible equivalents so the esbuild-bundled output runs under plain Node 20+ without depending on the Bun runtime. Documented as the preferred strategy during rebuild whenever modules reference Bun-specific globals that can't be trivially polyfilled by esbuild.
Key claims
- Ant-only dynamic require() calls must be stubbed to avoid esbuild resolution failure
Relations
- Bun-Specific API Stubs --[replaces]--> Bun Runtime