import { cssBundleHref } from "@remix-run/css-bundle"; import { json, type SerializeFrom, type LinksFunction } from "@remix-run/node"; import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration, useLoaderData, } from "@remix-run/react"; import useFathom from "./hooks/use-fathom"; export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; export const loader = () => json({ siteConfig: { fathom: { siteId: process.env.FATHOM_SITE_ID!, domain: process.env.FATHOM_CUSTOM_DOMAIN!, }, }, }); declare global { interface Window { siteConfig: SerializeFrom["siteConfig"]; } } export default function App() { const { siteConfig } = useLoaderData(); useFathom(); return (