build: enable frontend module code splitting

This commit is contained in:
sjg
2026-08-01 14:40:59 +02:00
parent 1a42d58075
commit 26be675242
25 changed files with 8931 additions and 9455 deletions
@@ -6,6 +6,7 @@ import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
import vm from "node:vm";
import { bundleEntry } from "./bundle-entry.mjs";
test("FT2 entry normalizes audio offsets and registers typed callbacks", async () => {
let barRenderer;
@@ -30,7 +31,7 @@ test("FT2 entry normalizes audio offsets and registers typed callbacks", async (
console,
});
const runtime = await readFile(new URL("../../assets/web/generated/plugin-runtime.js", import.meta.url), "utf8");
const source = await readFile(new URL("../../assets/web/generated/ft2.js", import.meta.url), "utf8");
const source = await bundleEntry(new URL("../src/plugins/ft2.ts", import.meta.url));
new vm.Script(runtime).runInContext(context);
new vm.Script(source).runInContext(context);
@@ -62,7 +63,7 @@ test("FT8 entry installs shared parsing without relying on script globals", asyn
console,
});
const runtime = await readFile(new URL("../../assets/web/generated/plugin-runtime.js", import.meta.url), "utf8");
const source = await readFile(new URL("../../assets/web/generated/ft8.js", import.meta.url), "utf8");
const source = await bundleEntry(new URL("../src/plugins/ft8.ts", import.meta.url));
new vm.Script(runtime).runInContext(context);
new vm.Script(source).runInContext(context);