Files
shihaam 010d98df1c Add 'frontend/' from commit '63381d9f2a4829e09d9ba6f29608bbaa2eb38601'
git-subtree-dir: frontend
git-subtree-mainline: 79bc04aaa7
git-subtree-split: 63381d9f2a
2026-07-31 23:53:50 +05:00

27 lines
715 B
TypeScript

import path from 'node:path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(import.meta.dirname, './src'),
},
},
server: {
port: 5173,
// Proxy API calls in dev so the browser talks to same-origin /api,
// avoiding CORS. The API key is sent as a header, never in the URL.
proxy: {
'/api': {
target: process.env.VITE_API_TARGET ?? 'http://10.0.1.235:8000',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, ''),
},
},
},
})