50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { fileURLToPath, URL } from "node:url";
|
|
|
|
const srcDir = fileURLToPath(new URL("./src", import.meta.url));
|
|
const apiTarget = process.env.API_URL || "http://127.0.0.1:3000";
|
|
const webPort = Number(process.env.VITE_PORT) || 5173;
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": srcDir,
|
|
},
|
|
},
|
|
server: {
|
|
host: process.env.VITE_HOST || "127.0.0.1",
|
|
port: webPort,
|
|
strictPort: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
sourcemap: false,
|
|
chunkSizeWarningLimit: 1200,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
react: ["react", "react-dom", "react-router-dom"],
|
|
calendar: [
|
|
"@fullcalendar/core",
|
|
"@fullcalendar/react",
|
|
"@fullcalendar/daygrid",
|
|
"@fullcalendar/timegrid",
|
|
"@fullcalendar/interaction",
|
|
],
|
|
charts: ["recharts"],
|
|
query: ["@tanstack/react-query"],
|
|
icons: ["lucide-react"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|