Files
storkit/frontend/vite.config.ts
dave f610ef6046 Restore codebase deleted by bad auto-commit e4227cf
Commit e4227cf (a story creation auto-commit) erroneously deleted 175
files from master's tree, likely due to a race condition between
concurrent git operations. This commit re-adds all files from the
working directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:07:07 +00:00

52 lines
1.3 KiB
TypeScript

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig(() => {
const backendPort = Number(process.env.STORKIT_PORT || "3001");
return {
plugins: [react()],
define: {
__STORKIT_PORT__: JSON.stringify(String(backendPort)),
__BUILD_TIME__: JSON.stringify(new Date().toISOString()),
},
server: {
port: backendPort + 2172,
proxy: {
"/api": {
target: `http://127.0.0.1:${String(backendPort)}`,
timeout: 120000,
configure: (proxy) => {
proxy.on("error", (_err) => {
// Swallow proxy errors (e.g. ECONNREFUSED during backend restart)
// so the vite dev server doesn't crash.
});
},
},
"/agents": {
target: `http://127.0.0.1:${String(backendPort)}`,
timeout: 120000,
configure: (proxy) => {
proxy.on("error", (_err) => {});
},
},
},
watch: {
ignored: [
"**/.story_kit/**",
"**/target/**",
"**/.git/**",
"**/server/**",
"**/Cargo.*",
"**/vendor/**",
"**/node_modules/**",
],
},
},
build: {
outDir: "dist",
emptyOutDir: true,
},
};
});