From 6cd6514daaccdd65b7a783f3f28d9e96603a7120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Tue, 7 Apr 2026 02:53:23 +0200 Subject: [PATCH] fix(producer): extract head styles/scripts from non-template sub-compositions Mirrors the runtime compositionLoader fix: the producer's inlineSubCompositions() was parsing only `bodyEl.innerHTML`, discarding all content. CSS backgrounds, positioning, fonts, and library scripts (GSAP CDN) defined in were silently dropped during compilation. Also externalizes postcss in the esbuild config to fix "Dynamic require of path is not supported" error that broke local dev rendering via `npx tsx cli render`. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../producer/src/services/htmlCompiler.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/producer/src/services/htmlCompiler.ts b/packages/producer/src/services/htmlCompiler.ts index 7ac6a0b53..a737d6f23 100644 --- a/packages/producer/src/services/htmlCompiler.ts +++ b/packages/producer/src/services/htmlCompiler.ts @@ -525,6 +525,31 @@ function inlineSubCompositions( : contentDoc.querySelector("[data-composition-id]"); const inferredCompId = innerRoot?.getAttribute("data-composition-id")?.trim() || null; + // When a sub-composition is a full HTML document (no