import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import { fileURLToPath } from "node:url"; // Pekar @agent-helm/shared direkt på TS-källan och låter Vite transpilera den // som vanlig app-kod (slipper bygg-steg för shared i den tunna slicen). const sharedSrc = fileURLToPath(new URL("../shared/src/index.ts", import.meta.url)); const repoRoot = fileURLToPath(new URL("../../", import.meta.url)); export default defineConfig({ plugins: [vue()], envDir: repoRoot, resolve: { alias: { "@agent-helm/shared": sharedSrc, }, }, server: { host: true, fs: { allow: [repoRoot] }, // Proxa API + WS till control-plane så dev körs same-origin (cookie-auth funkar). // Webben ansluter WS till `${origin}/ws`; servern accepterar WS på valfri path. proxy: { "/api": { target: "http://localhost:8787", changeOrigin: true }, "/auth": { target: "http://localhost:8787", changeOrigin: true }, "/ws": { target: "ws://localhost:8787", ws: true }, }, }, });