MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / bundle

Function bundle

packages/cli/src/server/studioServer.ts:298–315  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

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 } =

Callers

nothing calls this directly

Calls 2

bundleToSingleHtmlFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected