Files
Sauci/apps/admin/vite.config.ts
jjbruntonandClaude Fable 5 d298a33656 feat(admin): proxy /v1 API calls through the local admin dev server
The API has no CORS handling, so local admin development serves API calls
same-origin and forwards them to the local API process.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 20:12:23 +01:00

42 lines
1.1 KiB
TypeScript
Executable File

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
optimizeDeps: {
include: ['react-icons/io5'],
},
build: {
rollupOptions: {
output: {
manualChunks: {
'react-icons': ['react-icons/io5'],
},
},
},
},
server: {
host: true,
port: 3001,
allowedHosts: ['manage.sauci.app'],
// The API has no CORS handling, so local development serves API calls
// same-origin and forwards them to the local API process.
proxy: {
'/v1': {
target: process.env.SAUCI_ADMIN_API_PROXY ?? 'http://127.0.0.1:3003',
changeOrigin: true,
},
},
watch: {
usePolling: true,
interval: 100,
},
},
});