Vitest-style suite was caught by tsx --test and broke npm test. Align with storage.test.ts and narrow vitest include to chat suites. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const enableDemoSeeds = process.env.VITE_ENABLE_DEMO_SEEDS === 'true';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@demo-seeds': path.resolve(
|
|
__dirname,
|
|
enableDemoSeeds
|
|
? 'src/data/demoSeeds.enabled.ts'
|
|
: 'src/data/demoSeeds.disabled.ts',
|
|
),
|
|
},
|
|
},
|
|
// @ts-expect-error vitest config field
|
|
test: {
|
|
// Only vitest-style suites (tsx/node:test covers the rest via npm test).
|
|
include: ['src/components/chat/**/*.test.ts'],
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 3100,
|
|
// FRP / reverse-proxy Host headers (e.g. frp-mix.com → :3100)
|
|
allowedHosts: ['.frp-mix.com'],
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8080',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: true,
|
|
},
|
|
});
|