import { build } from "esbuild"; import { copyFileSync, mkdirSync, rmSync } from "node:fs"; import { createRequire } from "node:module"; // slopbox's own bundles: the terminal pane (xterm + its fit addon) and the Shell tab's // bash interpreter (bashkit). Both used to live in @nibling/kernel's build; they moved // here with the page, since nothing in the runtime package itself depends on them. // dist/demo/ (not plain dist/) on purpose: slopbox.js and the shell test still say // "/dist/demo/terminal.js" etc, unchanged from when these bundles lived in the // runtime's own dist/demo/. Keeping the same shape here means those files needed no edits. const DIST = "dist/demo"; const common = { bundle: true, target: "es2022", minify: true }; rmSync(DIST, { recursive: true, force: true }); await Promise.all([ // The terminal pane. The stylesheet loads as text so the bundle is one file that // injects its own CSS (xterm writes runtime CSS into