37 lines
845 B
TypeScript
37 lines
845 B
TypeScript
|
|
import react from "@vitejs/plugin-react";
|
||
|
|
import path from "node:path";
|
||
|
|
import { defineConfig } from "vite";
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [react()],
|
||
|
|
build: {
|
||
|
|
rollupOptions: {
|
||
|
|
output: {
|
||
|
|
manualChunks(id) {
|
||
|
|
if (id.includes("@svar-ui/react-gantt")) {
|
||
|
|
return "gantt-vendor";
|
||
|
|
}
|
||
|
|
if (id.includes("@tanstack/react-query")) {
|
||
|
|
return "query-vendor";
|
||
|
|
}
|
||
|
|
if (id.includes("react-router-dom") || id.includes("react-dom") || id.includes(`${path.sep}react${path.sep}`)) {
|
||
|
|
return "react-vendor";
|
||
|
|
}
|
||
|
|
return undefined;
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
"@": path.resolve(__dirname, "src"),
|
||
|
|
},
|
||
|
|
},
|
||
|
|
server: {
|
||
|
|
port: 5173,
|
||
|
|
proxy: {
|
||
|
|
"/api": "http://localhost:3000",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
});
|