import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // https://vite.dev/config/ export default defineConfig(({ mode }) => ({ // A relative base under `--mode pages`, so the build works wherever it is // mounted (a Pages project subpath, or a site root); local dev stays at root. base: mode === "pages" ? "./" : "/", plugins: [react()], // numbl is built primarily for Node; a few code paths reference `process`. // The reachable ones are guarded with `typeof process !== "undefined"`, but // we statically replace the bare member accesses so nothing throws in the // browser bundle (and the optional C-JIT path, which we never use here, is // inert at opt level "1"). define: { "process.platform": JSON.stringify("browser"), "process.env": "{}", }, }));