/** * Worker bundle size guard. * * Cloudflare Workers enforce a per-script size limit (gzipped): ~3MB on the * free plan, ~10MB on paid. A bundle that blows past this only fails at UPLOAD * with a terse "Payload Too Large" — by then the user has waited through a full * build with no hint at the cause. The usual culprit is a native (.node) module * (e.g. better-sqlite3) getting inlined into the worker. * * This evaluates the bundled script size BEFORE upload so the build can fail * fast with the actual size, the limit, the largest files, and a likely cause. * Pure + exported for testing; build.ts feeds it real sizes. */ export declare const WFP_FREE_LIMIT: number; export declare const WFP_PAID_LIMIT: number; export interface ScriptFileSize { /** File name (e.g. "worker.js", "-compiler.wasm"). */ name: string; /** Gzipped size in bytes (what the Workers limit is measured against). */ gzipSize: number; } export interface BundleSizeVerdict { /** "ok" ≤ free limit; "free-warning" over free but ≤ paid; "over-limit" over paid. */ level: "ok" | "free-warning" | "over-limit"; totalGzip: number; /** Human-readable warning/error text (null when ok). */ message: string | null; } /** * Classify a bundled worker's gzipped script size against the Workers limits. * `nativeRefs` (count of quoted `.node` filename references in the worker — * inlined native modules, not bare `.node` property access) drives a * native-module hint on the over-limit message. */ export declare function evaluateBundleSize(files: ScriptFileSize[], opts?: { nativeRefs?: number; freeLimit?: number; paidLimit?: number; }): BundleSizeVerdict; //# sourceMappingURL=bundle-size.d.ts.map