| import tailwindcss from '@tailwindcss/vite'; | |
| import react from '@vitejs/plugin-react'; | |
| import { fileURLToPath } from 'node:url'; | |
| export function createViteConfig() { | |
| return { | |
| configFile: false, | |
| root: process.cwd(), | |
| base: '/ui/', | |
| plugins: [react(), tailwindcss()], | |
| resolve: { | |
| alias: { | |
| '@': fileURLToPath(new URL('..', import.meta.url)), | |
| }, | |
| }, | |
| server: { | |
| hmr: process.env.DISABLE_HMR !== 'true', | |
| watch: process.env.DISABLE_HMR === 'true' ? null : {}, | |
| proxy: { | |
| '/api': 'http://127.0.0.1:7860', | |
| }, | |
| }, | |
| }; | |
| } | |