Loader

VLoader
Bun

Symbol

Loader

let Loader: { dependencyKeysIfEvaluated: (specifier: string) => string[]; registry: Map<string, { dependencies: typeof Loader['registry'] extends Map<any, infer V> ? V : any[]; evaluated: boolean; fetch: Promise<any>; instantiate: Promise<any>; isAsync: boolean; key: string; linkError: any; linkSucceeded: boolean; module: { dependenciesMap: typeof Loader['registry'] }; satisfy: Promise<any>; state: number; then: any }>; resolve: (specifier: string, referrer: string) => string }

Low-level JavaScriptCore API for accessing the native ES Module loader (not a Bun API)

Before using this, be aware of a few things:

Using this incorrectly will crash your application.

This API may change any time JavaScriptCore is updated.

Bun may rewrite ESM import specifiers to point to bundled code. This will be confusing when using this API, as it will return a string like "/node_modules.server.bun".

Bun may inject additional imports into your code. This usually has a bun: prefix.