import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' const entry = (p: string) => fileURLToPath(new URL(p, import.meta.url)) export default defineConfig({ plugins: [react()], server: { port: 5173, proxy: { '/api': 'http://localhost:3001', '/uploads': 'http://localhost:3001', '/sample': 'http://localhost:3001' } }, build: { rollupOptions: { // 主站与广告落地页各自独立入口,落地页不共享主站路由与全局样式。 input: { main: entry('./index.html'), landing: entry('./landing.html'), }, }, }, })