Use CodeMirror editor

This commit is contained in:
2026-06-05 10:10:58 +02:00
parent 4e24f876c9
commit de3abed6d7
15 changed files with 1207 additions and 283 deletions
+22
View File
@@ -0,0 +1,22 @@
// Builds the vendored CodeMirror 6 bundle consumed by the page editor.
//
// Output is an IIFE that assigns the CM primitives the editor scripts need
// onto window.CM (see entry.js). The editor JS is loaded as plain global
// scripts, not ES modules, so there is no runtime module loader.
//
// Run via `make editor` (or `npm run build` here) after changing CM versions.
// The committed artifact at assets/editor/vendor/codemirror.bundle.js is the
// only thing `go build` ever sees.
import * as esbuild from "esbuild";
await esbuild.build({
entryPoints: ["entry.js"],
bundle: true,
format: "iife",
minify: true,
target: ["es2018"],
legalComments: "none",
outfile: "../assets/editor/vendor/codemirror.bundle.js",
});
console.log("built assets/editor/vendor/codemirror.bundle.js");