import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' // https://vite.dev/config/ export default defineConfig(({ command }) => ({ plugins: [ command === 'serve' && { name: 'react-refresh-preamble-fix', transformIndexHtml() { return [{ tag: 'script', attrs: { type: 'module' }, children: ` import RefreshRuntime from "/@react-refresh"; RefreshRuntime.injectIntoGlobalHook(window); window.$RefreshReg$ = () => {}; window.$RefreshSig$ = () => (type) => type; window.__vite_plugin_react_preamble_installed__ = true; ` }] } }, react(), tailwindcss() ], server: { port: 3001, proxy: { '/api': { target: 'http://localhost:3004', changeOrigin: true, } } }, preview: { port: 3000, proxy: { '/api': { target: 'http://localhost:3004', changeOrigin: true, } } } }))