@sentry/remix
Version:
Official Sentry SDK for Remix
28 lines • 1.54 kB
TypeScript
/** Node's synchronous `load` hook shape, which `@remix-run/assets` reuses for `scripts.loaders`. */
export interface ModuleLoadContext {
moduleUrl?: string;
[key: string]: unknown;
}
export interface ModuleLoadResult {
format: string | null | undefined;
shortCircuit?: boolean;
source?: string | ArrayBuffer | ArrayBufferView;
}
export type ModuleLoader = (url: string, context: ModuleLoadContext, nextLoad: (url: string, context?: Partial<ModuleLoadContext>) => ModuleLoadResult) => ModuleLoadResult;
/**
* An asset server loader that applies orchestrion's transform to browser modules. Remix 3 has no
* bundler, so the asset server's loader chain is the only compile time hook there is.
*
* `dcModuleUrl`, the shim's public URL, must also be in `scripts.external`, so the compiler leaves
* the injected import alone.
*/
export declare function orchestrionLoader(dcModuleUrl: string): ModuleLoader;
export declare function isOrchestrionLoader(loader: unknown): boolean;
/**
* Public URL of the shipped shim under the asset server's `node_modules` mount, encoded per segment as
* the asset server encodes imports. `@sentry` and `%40sentry` are different modules to a browser; a
* mismatch loads two shims and instrumentation quietly does nothing.
*/
export declare function getShimUrl(basePath: string, rootDir: string, mounts: Readonly<Record<string, string>> | undefined, shimPath: string): string | undefined;
export declare function resolveShimPath(): string;
//# sourceMappingURL=orchestrionLoader.d.ts.map