perf(admin-web): drop KaTeX fonts from editor bundle

Import individual Crepe common stylesheets instead of the aggregate, which
transitively pulled in latex.css and emitted ~59 KaTeX font files even
though CrepeFeature.Latex is disabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-27 09:07:57 +08:00
parent 93ff3c773f
commit 021ef7fc79
@@ -50,7 +50,23 @@ import {
import type { Ctx } from "@milkdown/kit/ctx";
import { callCommand, replaceAll } from "@milkdown/kit/utils";
import { Crepe, CrepeFeature } from "@milkdown/crepe";
import "@milkdown/crepe/theme/common/style.css";
// NOTE: import each common stylesheet explicitly instead of the aggregate
// `theme/common/style.css`. The aggregate transitively `@import`s `latex.css`,
// which pulls in `katex/dist/katex.min.css` and emits ~59 KaTeX font files
// into dist/assets/fonts even though we disable CrepeFeature.Latex. We don't
// render math, so skip latex.css to drop the fonts from the bundle.
import "@milkdown/crepe/theme/common/prosemirror.css";
import "@milkdown/crepe/theme/common/reset.css";
import "@milkdown/crepe/theme/common/block-edit.css";
import "@milkdown/crepe/theme/common/code-mirror.css";
import "@milkdown/crepe/theme/common/cursor.css";
import "@milkdown/crepe/theme/common/image-block.css";
import "@milkdown/crepe/theme/common/link-tooltip.css";
import "@milkdown/crepe/theme/common/list-item.css";
import "@milkdown/crepe/theme/common/placeholder.css";
import "@milkdown/crepe/theme/common/toolbar.css";
import "@milkdown/crepe/theme/common/table.css";
import "@milkdown/crepe/theme/common/top-bar.css";
import "@milkdown/crepe/theme/frame.css";
import {
computed,