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