mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
30 lines
666 B
TypeScript
30 lines
666 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
|
|
// Backend port - can be overridden via VITE_API_PORT env var
|
|
const apiPort = process.env.VITE_API_PORT || '8888'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: `http://127.0.0.1:${apiPort}`,
|
|
changeOrigin: true,
|
|
},
|
|
'/ws': {
|
|
target: `ws://127.0.0.1:${apiPort}`,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
})
|