24 lines
440 B
TypeScript
24 lines
440 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
const apiProxy = {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:4242',
|
|
changeOrigin: true,
|
|
},
|
|
}
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
host: true,
|
|
port: 5173,
|
|
proxy: apiProxy,
|
|
},
|
|
// `vite preview` does not inherit dev server proxy unless set here
|
|
preview: {
|
|
proxy: apiProxy,
|
|
},
|
|
})
|