Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

vite.config.ts

47 lines1.2 KB

1import { defineConfig, mergeConfig } from 'vitest/config'
2import { tanstackViteConfig } from '@tanstack/vite-config'
3import packageJson from './package.json'
4​
5const config = defineConfig({
6 test: {
7 name: packageJson.name,
8 dir: './',
9 watch: false,
10 globals: true,
11 environment: 'node',
12 include: ['src/**/*.test.ts', 'tests/**/*.test.ts'],
13 coverage: {
14 provider: 'v8',
15 reporter: ['text', 'json', 'html', 'lcov'],
16 exclude: [
17 'node_modules/',
18 'dist/',
19 'tests/',
20 '**/*.test.ts',
21 '**/*.config.ts',
22 ],
23 include: ['src/**/*.ts'],
24 },
25 },
26})
27​
28export default mergeConfig(
29 config,
30 tanstackViteConfig({
31 entry: [
32 './src/index.ts',
33 './src/providers/in-memory/index.ts',
34 './src/providers/redis/index.ts',
35 './src/providers/hindsight/index.ts',
36 './src/providers/mem0/index.ts',
37 './src/providers/honcho/index.ts',
38 './src/testkit/contract.ts',
39 ],
40 srcDir: './src',
41 // The contract testkit imports Vitest; keep it external so the built
42 // artifact references the consumer's Vitest at test time instead of
43 // bundling the runner.
44 externalDeps: ['vitest'],
45 cjs: false,
46 }),