first runnable version

This commit is contained in:
yoyuzh
2026-03-14 12:28:46 +08:00
parent 8db2fa2aab
commit 6cff15f8dc
35 changed files with 2118 additions and 256 deletions

View File

@@ -1,10 +1,12 @@
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import {defineConfig, loadEnv} from 'vite';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig(({mode}) => {
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
const backendUrl = env.VITE_BACKEND_URL || 'http://localhost:8080';
return {
plugins: [react(), tailwindcss()],
define: {
@@ -16,9 +18,13 @@ export default defineConfig(({mode}) => {
},
},
server: {
// HMR is disabled in AI Studio via DISABLE_HMR env var.
// Do not modify—file watching is disabled to prevent flickering during agent edits.
hmr: process.env.DISABLE_HMR !== 'true',
proxy: {
'/api': {
target: backendUrl,
changeOrigin: true,
},
},
},
};
});