Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
82 lines (79 loc) · 1.96 KB
/
Copy pathvite.config.ts
File metadata and controls
82 lines (79 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { offlinePlugin } from './build/offline.ts';
import { defineConfig } from 'vitest/config';
import { fileURLToPath } from 'node:url';
const root = fileURLToPath(new URL('.', import.meta.url));
const inferenceProxy = {
'/inference': {
target: 'https://opencode.ai',
changeOrigin: true,
headers: {
'user-agent': 'spider/0.1',
'x-opencode-session': 'spider-local-dev',
},
},
};
export default defineConfig({
plugins: [offlinePlugin()],
resolve: {
alias: {
'@': root,
},
},
worker: { format: 'es' },
base: './',
build: {
outDir: 'dist/client',
emptyOutDir: true,
minify: 'oxc',
cssMinify: true,
chunkSizeWarningLimit: 900,
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{ name: 'three', test: /node_modules[\\/]three[\\/]/, priority: 20 },
{ name: 'ai', test: /node_modules[\\/](ai|@ai-sdk|zod)[\\/]/, priority: 15 },
],
},
},
},
},
server: {
port: 3300,
strictPort: true,
proxy: inferenceProxy,
},
preview: {
port: 3300,
strictPort: true,
proxy: inferenceProxy,
},
test: {
environment: 'jsdom',
include: ['tests/**/*.test.ts', 'src/ui/**/*.test.ts'],
setupFiles: ['tests/setup.ts'],
restoreMocks: true,
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}', 'worker/src/**/*.js'],
exclude: [
'src/client/models/page.ts',
'src/client/worker/journal.worker.ts',
'src/client/worker/world.worker.ts',
'src/client/local/inference.worker.ts',
'src/client/storage/storage.worker.ts',
'src/client/worker/protocol.ts',
'src/client/worker/worldProtocol.ts',
'src/ui/**/*.test.ts',
],
reporter: ['text', 'lcov'],
reportsDirectory: 'coverage',
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
},
});