Bearer для /metrics (EVOBGP_METRICS_TOKEN); rate limit /v1/auth/config; constant-time agent secret; OTel stub; Playwright smoke; HTTP_PROXY note; checklist обновлён. Co-authored-by: Cursor <[email protected]>
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { TanStackRouterVite as TanStackRouterPlugin } from '@tanstack/router-plugin/vite'
|
|
import path from 'node:path'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
TanStackRouterPlugin({ target: 'react', autoCodeSplitting: true }),
|
|
react(),
|
|
tailwindcss(),
|
|
],
|
|
resolve: {
|
|
alias: [
|
|
// shadcn components inside packages/ui import '@/hooks/use-mobile' (their own alias).
|
|
// Vite doesn't read tsconfig paths from packages/ui; expose a fallback so those imports
|
|
// resolve to packages/ui/src/hooks instead of apps/web/src/hooks.
|
|
{
|
|
find: '@/hooks/use-mobile',
|
|
replacement: path.resolve(__dirname, '../../packages/ui/src/hooks/use-mobile.ts'),
|
|
},
|
|
{ find: '@', replacement: path.resolve(__dirname, './src') },
|
|
{ find: '@evobgp/ui/components', replacement: path.resolve(__dirname, '../../packages/ui/src/components') },
|
|
{ find: '@evobgp/ui/hooks', replacement: path.resolve(__dirname, '../../packages/ui/src/hooks') },
|
|
{ find: '@evobgp/ui/lib/utils', replacement: path.resolve(__dirname, '../../packages/ui/src/lib/utils.ts') },
|
|
],
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/v1': { target: 'http://127.0.0.1:8080', changeOrigin: true },
|
|
'/metrics': { target: 'http://127.0.0.1:8080', changeOrigin: true },
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'happy-dom',
|
|
globals: true,
|
|
exclude: ['**/node_modules/**', '**/e2e/**', '**/dist/**'],
|
|
},
|
|
})
|