mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
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>
42 lines
1.1 KiB
TypeScript
Executable File
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,
|
|
},
|
|
},
|
|
});
|