40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
|
import path from "path";
|
|
|
|
import dotenv from "dotenv";
|
|
import { fileURLToPath } from "url";
|
|
dotenv.config({
|
|
path: path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.env"),
|
|
});
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
TanStackRouterVite({ target: "react", autoCodeSplitting: true }),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": {
|
|
target: `http://localhost:${Number(process.env.VITE_SERVER_PORT || 4400)}`,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
"/ocme": {
|
|
target: `http://localhost:${Number(process.env.VITE_SERVER_PORT || 4400)}`,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
},
|
|
},
|
|
});
|