2026-02-13 12:31:36 +00:00
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
2026-02-19 17:14:33 +00:00
|
|
|
export default defineConfig(() => {
|
2026-02-19 17:29:50 +00:00
|
|
|
const backendPort = Number(process.env.STORYKIT_PORT || "3001");
|
2026-02-19 17:14:33 +00:00
|
|
|
return {
|
|
|
|
|
plugins: [react()],
|
2026-02-19 17:29:50 +00:00
|
|
|
define: {
|
|
|
|
|
__STORYKIT_PORT__: JSON.stringify(String(backendPort)),
|
2026-02-24 14:01:55 +00:00
|
|
|
__BUILD_TIME__: JSON.stringify(new Date().toISOString()),
|
2026-02-19 17:29:50 +00:00
|
|
|
},
|
2026-02-19 17:14:33 +00:00
|
|
|
server: {
|
2026-02-19 17:29:50 +00:00
|
|
|
port: backendPort + 2172,
|
2026-02-19 17:14:33 +00:00
|
|
|
proxy: {
|
|
|
|
|
"/api": {
|
2026-02-19 17:29:50 +00:00
|
|
|
target: `http://127.0.0.1:${String(backendPort)}`,
|
2026-02-19 17:14:33 +00:00
|
|
|
timeout: 120000,
|
|
|
|
|
},
|
2026-02-19 14:45:57 +00:00
|
|
|
},
|
2026-02-16 18:57:39 +00:00
|
|
|
},
|
2026-02-19 17:14:33 +00:00
|
|
|
build: {
|
|
|
|
|
outDir: "dist",
|
|
|
|
|
emptyOutDir: true,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
});
|