Playground: rename ui.mjs to ui.js so static hosts serve a JavaScript MIME type

The minds host sends .mjs as application/octet-stream, which browsers refuse for module imports.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Aqua 2026-11-04 13:39:11 +00:00
commit 6080f9b8f1
4 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ controls, so their slider panel is empty.
- `node test.mjs [dist]`: headless check of `dist/`: each patch compiles to wasm, renders 2 s
offline, is non-silent and finite; the thruster is also run at rpm 600 and 4800.
It cannot hear and does not run an AudioWorklet or a browser.
- `web/`: the page (`index.html`, `app.js`, `ui.mjs`, `styles.css`).
- `web/`: the page (`index.html`, `app.js`, `ui.js`, `styles.css`).
Serve `dist/` from any static host (`python3 -m http.server`); AudioWorklet needs `localhost` or https.
The older `tools/vocal-tract-playground` renders server-side through the .NET renderer; this one

View file

@ -8,7 +8,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
const dist = resolve(process.argv[2] ?? join(dirname(fileURLToPath(import.meta.url)), "dist"));
const { instantiateFaustModuleFromFile, LibFaust, FaustCompiler, FaustMonoDspGenerator } =
await import(pathToFileURL(join(dist, "vendor/faustwasm/index.js")).href);
const { controlsOf } = await import(pathToFileURL(join(dist, "ui.mjs")).href);
const { controlsOf } = await import(pathToFileURL(join(dist, "ui.js")).href);
const libfaust = new LibFaust(await instantiateFaustModuleFromFile(join(dist, "vendor/libfaust-wasm/libfaust-wasm.js")));
const compiler = new FaustCompiler(libfaust);

View file

@ -1,5 +1,5 @@
import { instantiateFaustModuleFromFile, LibFaust, FaustCompiler, FaustMonoDspGenerator } from "./vendor/faustwasm/index.js";
import { controlsOf } from "./ui.mjs";
import { controlsOf } from "./ui.js";
const $ = (id) => document.getElementById(id);
const status = (t) => { $("status").textContent = t; };