From 1671d04dec4899420d8db585612fb384e49b593b Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Sun, 12 Apr 2026 18:52:37 -0700 Subject: [PATCH] Revert dynamic HTML serving (broke Bun module bundling) The serveGenerated() approach for index.html served raw HTML, which broke bare module specifiers (import "motion") that Bun's HTML import bundler normally resolves. Restore the static import pattern. The live mode's auto-reload fallback still works for HMR-capable dev servers (Vite, Next.js). For Bun's serve() with static HTML imports, the dev server needs a restart to pick up HTML changes. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index 64d80dfcb..0e0327167 100644 --- a/server/index.js +++ b/server/index.js @@ -1,6 +1,8 @@ import { serve, file } from "bun"; import path from "node:path"; import { fileURLToPath } from "node:url"; +import homepage from "../public/index.html"; +import privacy from "../public/privacy.html"; import { getSkills, getCommands, @@ -37,8 +39,8 @@ const server = serve({ port: process.env.PORT || 3000, routes: { - "/": () => serveGenerated(path.join(ROOT_DIR, "public/index.html")), - "/privacy": () => serveGenerated(path.join(ROOT_DIR, "public/privacy.html")), + "/": homepage, + "/privacy": privacy, // Legacy URL redirects (kept stable for external links and existing users). "/cheatsheet": Response.redirect("/docs", 301),