variable

Loader

const 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, so this API can return a string like "/node_modules.server.bun".

Bun may inject additional imports into your code. These usually have a bun: prefix.