Use a relative base so the build works at any mount point
1 changed file+3−3
vite.config.tsmodified+3−3View file
@@ -2,10 +2,10 @@ import { defineConfig } from "vite";
22 import react from "@vitejs/plugin-react";
33
44 // https://vite.dev/config/
5-// Served from a project subpath on GitHub Pages when built with `--mode pages`
6-// (https://magland.github.io/numbl-figure-viewer/); local dev/build stays root.
5+// A relative base under `--mode pages`, so the build works wherever it is
6+// mounted (a Pages project subpath, or a site root); local dev stays at root.
77 export default defineConfig(({ mode }) => ({
8- base: mode === "pages" ? "/numbl-figure-viewer/" : "/",
8+ base: mode === "pages" ? "./" : "/",
99 plugins: [react()],
1010 // numbl is a linked (file:) dependency, so force a single React instance and
1111 // let Vite descend into the linked package to resolve its imports.