1import { defineConfig } from "vite";
2import react from "@vitejs/plugin-react";
4// https://vite.dev/config/
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.
7export default defineConfig(({ mode }) => ({
8 base: mode === "pages" ? "./" : "/",
9 plugins: [react()],
10 // numbl is a linked (file:) dependency, so force a single React instance and
11 // let Vite descend into the linked package to resolve its imports.
12 resolve: { dedupe: ["react", "react-dom"] },
13 optimizeDeps: { exclude: ["numbl"] },
14}));