import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; const rootPackage = JSON.parse( readFileSync( fileURLToPath(new URL("../../package.json", import.meta.url)), "utf8" ) ) as { version: string }; export default defineConfig({ plugins: [react()], publicDir: fileURLToPath( new URL("../../logos/web", import.meta.url) ), define: { __APP_VERSION__: JSON.stringify(rootPackage.version) }, build: { rollupOptions: { input: { main: fileURLToPath(new URL("./index.html", import.meta.url)), previewFrame: fileURLToPath( new URL("./preview-frame.html", import.meta.url) ) } } }, server: { port: 5173, proxy: { "/api": "http://localhost:3001" } } });