This commit is contained in:
Mikan
2026-06-20 19:13:05 +03:00
parent 32575e217e
commit 8514c63ec6
193 changed files with 22105 additions and 11660 deletions

View File

@@ -1,12 +1,12 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import { fileURLToPath, URL } from "node:url";
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
server: {
@@ -14,19 +14,18 @@ export default defineConfig({
port: 5173,
proxy: {
"/api": {
// NOTE: This URL is resolved INSIDE the vite dev-server container.
// `localhost` would refer to the container itself, not the host — so
// in docker-compose we set API_PROXY_TARGET=http://backend:8000 (the
// docker-compose service name). Outside docker (e.g. running vite
// locally against a backend on the host), leave it unset and the
// default http://localhost:8000 applies.
//
// Deliberately NOT prefixed with `VITE_` so it cannot leak into the
// browser bundle (browser code uses relative "/api" URLs only — see
// src/api/index.ts).
target: process.env.API_PROXY_TARGET || "http://localhost:8000",
target: "http://localhost:8000",
changeOrigin: true,
ws: true,
},
"/static": {
target: "http://localhost:8000",
changeOrigin: true,
},
},
},
build: {
outDir: "dist",
sourcemap: false,
},
});