vite.config.ts 640 B

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