2026-04-11 13:59:58 -07:00
|
|
|
import path from "node:path";
|
2026-04-08 10:01:19 -07:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
|
|
|
|
|
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET ?? "http://localhost:4300";
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
server: {
|
|
|
|
|
port: 4200,
|
|
|
|
|
proxy: {
|
|
|
|
|
"/api": apiProxyTarget,
|
|
|
|
|
"/uploads": apiProxyTarget
|
|
|
|
|
}
|
2026-04-11 13:59:58 -07:00
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks(id) {
|
|
|
|
|
if (
|
|
|
|
|
id.includes("packages/render-engine/src/render-surface") ||
|
|
|
|
|
id.includes("packages/render-engine/src/index") ||
|
|
|
|
|
id.includes("packages/render-engine/src/types") ||
|
|
|
|
|
id.includes("packages/render-engine/src/scene-loader")
|
|
|
|
|
) {
|
|
|
|
|
return "render-core";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (id.includes("packages/render-engine/src/scene-helpers")) {
|
|
|
|
|
return "render-scene-support";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (id.includes("packages/render-engine/src/text-overlay")) {
|
|
|
|
|
return "render-text";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (id.includes("packages/render-engine/src/scenes/")) {
|
|
|
|
|
return `scene-${path.basename(id, path.extname(id))}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (id.includes("node_modules/react") || id.includes("node_modules/react-dom")) {
|
|
|
|
|
return "react-vendor";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (id.includes("node_modules/@tanstack/react-virtual")) {
|
|
|
|
|
return "admin-virtual";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return undefined;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-08 10:01:19 -07:00
|
|
|
}
|
|
|
|
|
});
|