32 lines
629 B
TypeScript
32 lines
629 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig(({ mode }) => ({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
strictPort: true,
|
|
watch: {
|
|
usePolling: true,
|
|
},
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.VITE_API_BASE_URL || 'http://host.docker.internal:80',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: mode !== 'production',
|
|
},
|
|
}))
|