moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled

This commit is contained in:
Oleg Maslov
2026-09-02 10:10:29 +02:00
commit 0c3e2ead3b
3841 changed files with 970576 additions and 0 deletions

55
apps/web/vite.config.ts Normal file
View File

@@ -0,0 +1,55 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";
import { componentTagger } from "lovable-tagger";
// https://vitejs.dev/config/
const sidecarTarget = process.env.SIDECAR_TARGET ?? "http://127.0.0.1:3333";
export default defineConfig(({ mode }) => ({
server: {
host: "::",
port: 8080,
hmr: {
overlay: false,
},
proxy: {
"/api": {
target: sidecarTarget,
changeOrigin: true,
},
"/health": {
target: sidecarTarget,
changeOrigin: true,
},
"/ws": {
target: sidecarTarget.replace(/^http/, "ws"),
ws: true,
},
},
},
plugins: [react(), mode === "development" && componentTagger()].filter(Boolean),
build: {
rollupOptions: {
output: {
// Split the heaviest independent vendor libraries out of the single
// ~1.9MB app chunk so they cache separately and don't gate first paint.
// The React runtime + router stay in ONE chunk so context/singleton
// init order can't break across a chunk boundary.
manualChunks(id: string) {
if (!id.includes("node_modules")) return;
if (id.includes("framer-motion")) return "vendor-motion";
if (id.includes("recharts") || id.includes("d3-") || id.includes("victory-")) return "vendor-charts";
if (id.includes("@radix-ui")) return "vendor-radix";
if (/[\\/]node_modules[\\/](react|react-dom|react-router|react-router-dom|scheduler)[\\/]/.test(id)) return "vendor-react";
},
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
dedupe: ["react", "react-dom", "react/jsx-runtime", "react/jsx-dev-runtime"],
},
}));