- New src/lib/site-icons.ts: base64 data URIs for the 13 tiny classic icons actually referenced in markup (100–2000 bytes), replacing extra requests with inline payloads. home.png, dynamic flags and currency sets stay on the filesystem. - Default favicon is now served server-side as a base64 SVG data URI (memoized), while a DB-configured custom favicon still takes priority. - Icons render through <Image unoptimized>, so data URIs pass through untouched on all affected pages (home, login, register, settings, navigation, auth top bar, client loading).
16 lines
504 B
TypeScript
16 lines
504 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
let cached: string | null = null;
|
|
|
|
/**
|
|
* The bundled default favicon (public/favicon.svg) as a base64 data URI.
|
|
* Read once and memoized; only used when no custom favicon is configured.
|
|
*/
|
|
export function getDefaultFaviconDataUri(): string {
|
|
if (cached) return cached;
|
|
const raw = readFileSync(join(process.cwd(), "public", "favicon.svg"));
|
|
cached = `data:image/svg+xml;base64,${raw.toString("base64")}`;
|
|
return cached;
|
|
}
|