import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // https://vite.dev/config/ export default defineConfig(({ mode }) => ({ // Served from a project subpath on GitHub Pages // (https://magland.github.io/numbl-image-filter/). The deploy workflow builds // with `--mode pages`; local dev/build stays at root. base: mode === "pages" ? "/numbl-image-filter/" : "/", 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": "{}", }, }));