Webhooks for the AT Protocol airglow.run
atproto atprotocol automation webhook
12
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: css improvements

Hugo 39ceb684 c4d7016b

+14 -5
+5 -4
app/routes/_renderer.tsx
··· 24 24 function CssLinks() { 25 25 if (!import.meta.env.PROD) return <></>; 26 26 27 - const manifests = import.meta.glob<{ default: Record<string, { css?: string[] }> }>( 28 - "/dist/.vite/manifest.json", 29 - { eager: true }, 30 - ); 27 + const manifests = import.meta.glob<{ 28 + default: Record<string, { css?: string[]; isDynamicEntry?: boolean }>; 29 + }>("/dist/.vite/manifest.json", { eager: true }); 31 30 const manifest = Object.values(manifests)[0]?.default; 32 31 if (!manifest) return <></>; 33 32 34 33 const base = import.meta.env.BASE_URL ?? "/"; 35 34 const seen = new Set<string>(); 36 35 for (const entry of Object.values(manifest)) { 36 + // Island CSS loads on-demand when their JS hydrates — no need to render-block 37 + if (entry.isDynamicEntry) continue; 37 38 for (const css of entry.css ?? []) { 38 39 seen.add(css); 39 40 }
+9 -1
app/server.ts
··· 16 16 // Static files (production only — Vite serves these in dev) 17 17 if (import.meta.env.PROD) { 18 18 const { serveStatic } = await import("hono/bun"); 19 - app.use("/static/*", serveStatic({ root: "./dist" })); 19 + app.use( 20 + "/static/*", 21 + serveStatic({ 22 + root: "./dist", 23 + onFound: (_path, c) => { 24 + c.header("Cache-Control", "public, max-age=31536000, immutable"); 25 + }, 26 + }), 27 + ); 20 28 app.use("/favicon.svg", serveStatic({ root: "./dist" })); 21 29 } 22 30