-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
35 lines (34 loc) · 907 Bytes
/
Copy pathvite.config.ts
File metadata and controls
35 lines (34 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
// https://vite.dev/config/
export default defineConfig({
plugins: [
react({
babel: {
plugins: ['babel-plugin-react-compiler'],
},
}),
tailwindcss(),
],
build: {
outDir: 'dist',
emptyOutDir: true,
},
// This is configured for ViteApiProxyExample
server: {
// Configure Vite’s dev-time proxy
proxy: {
'/apiproxy': {
// Actual external API target
target: 'https://dog.ceo',
// Ensure the host header is updated to match the target
changeOrigin: true,
// Allow HTTPS (even with self-signed certs)
secure: true,
// Rewrites /apiproxy/api/... to /api/... for the actual backend
rewrite: (path) => path.replace(/^\/apiproxy/, ''),
},
},
},
});