import { isImmersive } from '#lib/chrome.js'; import type { LayoutLoad } from './$types'; // The site header/footer (icon libraries, dropdowns, the bits-ui Sheet) live in SiteChrome, // imported only for pages that show them. Immersive pages (the book reader) never // download that code. Universal loads may return components. export const load: LayoutLoad = async ({ data, url }) => ({ ...data, Chrome: isImmersive(url.pathname) ? null : (await import('#lib/components/SiteChrome.svelte')).default });