proposal-system/web/vite.config.ts
Adam Moussa e6e2c60c2f
feat(web): scaffold domain module layer (proposals, lineItems, customers, pricingLibrary, admin, sites)
Additive-only: pages still use lib/api/* and constants/queryKeys.ts until
the page-migration agents run. Each domain ships api.ts (HTTP moved from
lib/api), types.ts (contract re-exports + view types), schemas.ts (contract
schema re-exports + form schemas with toRequest mappers), and use-cases.ts
(TanStack Query v5 hooks + hierarchical query keys, mirroring current page
invalidations and toast-on-error behavior).

Adds an explicit vite/vitest alias for the
@proposal-system/api-contracts/schemas subpath (package has no exports map)
plus a schema/mapper smoke test suite.
2026-07-13 17:58:19 -04:00

30 lines
956 B
TypeScript

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,
},
},
},
});