import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { fileURLToPath } from 'node:url' import { doocusApi } from './server/doocusApi' // Explicit output dirs (env). DOOCUS_OUTPUTS is comma-separated; DOOCUS_OUTPUT // (single) is honored too. Defaults to the repo's docs-output for back-compat. const outputEnv = process.env.DOOCUS_OUTPUTS ?? process.env.DOOCUS_OUTPUT const outputDirs = (outputEnv ? outputEnv.split(',').map((s) => s.trim()).filter(Boolean) : [fileURLToPath(new URL('../../docs-output', import.meta.url))]) // Managed collection roots (gitignored), discovered automatically: // doocus-data// → document collections (UI "Scan" writes here) // meetus-data// → meeting collections (from the meetus batch) // Collections that share the same index.json `root` are the same source and are // grouped together in the UI. Override with DOOCUS_DATA (comma-separated). const outputsRoots = process.env.DOOCUS_DATA ? process.env.DOOCUS_DATA.split(',').map((s) => s.trim()).filter(Boolean) : [ fileURLToPath(new URL('../../doocus-data', import.meta.url)), fileURLToPath(new URL('../../meetus-data', import.meta.url)), ] // Repo root — where process_tree.py lives (run via `uv run` for the scan). const repoRoot = fileURLToPath(new URL('../../', import.meta.url)) export default defineConfig({ plugins: [vue(), doocusApi({ outputDirs, outputsRoots, repoRoot })], resolve: { alias: { '@framework': fileURLToPath(new URL('../framework/src', import.meta.url)), // Compose meetus's own review components (single source; portable imports). '@meetus': fileURLToPath(new URL('../meetus-app/src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, server: { fs: { // Allow the dev server to read the framework + meetus-app source and every output tree. allow: [ fileURLToPath(new URL('.', import.meta.url)), fileURLToPath(new URL('../framework', import.meta.url)), fileURLToPath(new URL('../meetus-app', import.meta.url)), ...outputDirs, ...outputsRoots, ], }, }, })