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