import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], resolve: { // @proposal-system/api-contracts is a file: symlink; preserve it so its // 'zod' import resolves from web/node_modules in CI (shared has no // installed node_modules there). preserveSymlinks: true, alias: { // The package has no `exports` map (main points at src/index.ts), so // the /schemas subpath entrypoint needs an explicit alias (mirrors the // tsconfig `paths` mapping; vitest.config.ts carries the same alias). '@proposal-system/api-contracts/schemas': fileURLToPath( new URL('../shared/api-contracts/src/schemas.ts', import.meta.url) ), }, }, server: { port: 5173, proxy: { '/api': { target: 'http://localhost:5000', changeOrigin: true, }, }, }, });