import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// Separate Vite entry for the editorial dashboard.
//   Dev:   npm run dev:editorial   (port 5175, proxy /api -> Bun on 3456)
//   Build: npm run build:editorial (outputs to dist-editorial/)
//
// Production: the Bun server mounts dist-editorial/ under /editorial/* (see api/server.ts).
export default defineConfig({
  root: 'src-editorial',
  base: '/editorial/',
  publicDir: false,
  plugins: [vue()],
  server: {
    port: 5175,
    strictPort: true,
    host: '127.0.0.1',
    proxy: {
      '/api': 'http://127.0.0.1:3456'
    }
  },
  build: {
    outDir: '../dist-editorial',
    emptyOutDir: true
  }
})
