fix(cli): localize remote fonts in snapshot/check capture to match render

This commit is contained in:
Vance Ingalls
2026-07-11 16:14:36 -07:00
parent 35c231e35f
commit ad0d2393fe
5 changed files with 80 additions and 6 deletions
+4 -2
View File
@@ -193,11 +193,13 @@ async function captureSnapshots(
zoomScale?: number;
},
): Promise<string[]> {
const { bundleToSingleHtml } = await import("@hyperframes/core/compiler");
const { bundleWithLocalizedFonts } = await import("../utils/bundleWithLocalizedFonts.js");
const numFrames = opts.frames ?? 5;
const html = await bundleToSingleHtml(projectDir);
// Localize fonts (embed remote @font-face as data URIs, matching the render
// path) so snapshots render the real font instead of a fallback sans.
const html = await bundleWithLocalizedFonts(projectDir);
const server = await serveStaticProjectHtml(projectDir, html);
const savedPaths: string[] = [];