/** * Turbopack self-initializing loader for Domscribe transform * * Unlike the webpack loader (which relies on DomscribeWebpackPlugin for lifecycle), * this loader handles its own initialization, relay auto-start, and cleanup — * because Turbopack has no plugin system. * * Key differences from the webpack loader: * - Lazy singleton initialization on first invocation * - Eager ID cache persistence after every transform (workers are ephemeral) * - Client globals preamble injected into every file (server/client share one loader instance) * * @module @domscribe/transform/plugins/turbopack/turbopack-loader */ import type { LoaderContext } from 'webpack'; import type { SourceMap } from 'magic-string'; import type { TurbopackLoaderOptions, TurbopackInitResult } from './types.js'; /** * Returns the relay host/port after initialization completes. * Call this from meta-framework wrappers (e.g. @domscribe/next) to get relay info. */ export declare function getInitResult(): TurbopackInitResult; /** * Self-initializing Turbopack loader. * * Unlike the webpack loader (which relies on DomscribeWebpackPlugin for lifecycle), * this loader handles its own initialization, relay auto-start, and cleanup. * Turbopack has no plugin system — the loader is the only code that runs. * * Uses the same Turbopack-compatible loader APIs as the webpack loader: * this.async(), this.callback(), this.resourcePath, this.rootContext, this.getOptions() */ export default function turbopackLoader(this: LoaderContext, source: string, sourceMap?: SourceMap): string | void; //# sourceMappingURL=turbopack.loader.d.ts.map