DigitalLife

DigitalLife vite.config.ts

678 B 30 lines Raw ↗ GitHub ↗

import { defineConfig } from "vite";// The browser talks to Ollama through this dev-server proxy ("/ollama/...").// This avoids CORS problems entirely - no Ollama env setup needed.export default defineConfig({  server: {    open: true,    proxy: {      "/ollama": {        target: "http://localhost:11434",        changeOrigin: true,        rewrite: (path) => path.replace(/^\/ollama/, ""),        ws: false,      },    },  },  preview: {    proxy: {      "/ollama": {        target: "http://localhost:11434",        changeOrigin: true,        rewrite: (path) => path.replace(/^\/ollama/, ""),      },    },  },  build: {    target: "esnext",  },});