diff --git a/packages/cli/src/server/studioServer.previewAssets.test.ts b/packages/cli/src/server/studioServer.previewAssets.test.ts
index 14f6cb4151..6a3fa7071c 100644
--- a/packages/cli/src/server/studioServer.previewAssets.test.ts
+++ b/packages/cli/src/server/studioServer.previewAssets.test.ts
@@ -66,8 +66,11 @@ describe("studio preview document", () => {
// Kept URLs resolve against the preview's ]*id="nested" src="([^"]+)"/)?.[1];
- expect(nested).toBe("assets/pic@2x.png");
- expect(await fetchAsset(nested ?? "")).toEqual(PIC_2X);
+ // Scenes stay separate files the runtime fetches, so the first scene can play before the rest.
+ expect(html).toContain('data-composition-src="compositions/scene.html"');
+ expect(html).not.toContain('id="nested"');
+ const scene = (await fetchAsset("compositions/scene.html")).toString("utf-8");
+ expect(scene.match(/
]*id="nested" src="([^"]+)"/)?.[1]).toBe("../assets/pic@2x.png");
+ expect(await fetchAsset("assets/pic@2x.png")).toEqual(PIC_2X);
});
});
diff --git a/packages/core/src/compiler/htmlBundler.test.ts b/packages/core/src/compiler/htmlBundler.test.ts
index 119f7422a5..2af570a759 100644
--- a/packages/core/src/compiler/htmlBundler.test.ts
+++ b/packages/core/src/compiler/htmlBundler.test.ts
@@ -420,6 +420,32 @@ describe("bundleToSingleHtml", () => {
expect(hostEl?.hasAttribute("data-composition-src")).toBe(false);
});
+ it("leaves sub-composition hosts for the runtime to fetch with subCompositions: external", async () => {
+ const dir = makeTempProject({
+ "index.html": `
+
hi