(dir: string)
| 296 | resolveProject: (id: string) => (id === projectId ? project : null), |
| 297 | |
| 298 | async bundle(dir: string): Promise<string | null> { |
| 299 | try { |
| 300 | const { bundleToSingleHtml } = await import("@hyperframes/core/compiler"); |
| 301 | // Studio dev server: ask the bundler for an empty `src=""` placeholder so |
| 302 | // we can point it at our hot-reloadable local runtime endpoint. Inlining |
| 303 | // ~150 KB of runtime body on every preview render would defeat browser |
| 304 | // caching across composition edits. |
| 305 | let html = await bundleToSingleHtml(dir, { runtime: "placeholder" }); |
| 306 | html = html.replace( |
| 307 | 'data-hyperframes-preview-runtime="1" src=""', |
| 308 | 'data-hyperframes-preview-runtime="1" src="/api/runtime.js"', |
| 309 | ); |
| 310 | return html; |
| 311 | } catch (err) { |
| 312 | console.error("[studio] Bundle failed:", err); |
| 313 | return null; |
| 314 | } |
| 315 | }, |
| 316 | |
| 317 | async transformPreviewHtml({ html, project }) { |
| 318 | const { injectDeterministicFontFaces } = |
nothing calls this directly
no test coverage detected