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