mirror of
https://github.com/khairul169/garage-webui.git
synced 2025-06-17 22:29:32 +07:00
27 lines
602 B
TypeScript
27 lines
602 B
TypeScript
|
import { defineConfig, loadEnv } from "vite";
|
||
|
import react from "@vitejs/plugin-react-swc";
|
||
|
import path from "path";
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig(({ mode }) => {
|
||
|
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
|
||
|
|
||
|
return {
|
||
|
plugins: [react()],
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
"@": path.resolve(__dirname, "src"),
|
||
|
},
|
||
|
},
|
||
|
server: {
|
||
|
proxy: {
|
||
|
"/api": {
|
||
|
target: process.env.VITE_API_URL,
|
||
|
changeOrigin: true,
|
||
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
});
|