-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
56 lines (55 loc) · 2.07 KB
/
vite.config.js
File metadata and controls
56 lines (55 loc) · 2.07 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import communityPacksPlugin from './vite-plugins/community-packs-plugin.js'
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), communityPacksPlugin()],
cacheDir: process.env.VITE_CACHE_DIR || 'node_modules/.vite',
// Allow importing from .plugins/ directory (community packs)
optimizeDeps: {
include: ['killer-sudoku-generator'],
},
resolve: {
alias: {
'@datasets': path.resolve(__dirname, 'datasets'),
'@plugins': path.resolve(__dirname, '.plugins'),
'@enigma': path.resolve(__dirname, 'src/enigma-sdk'),
// Force vitest to use root node_modules better-sqlite3 (glibc) instead of backend's (musl)
'better-sqlite3': path.resolve(__dirname, 'node_modules/better-sqlite3'),
}
},
server: {
host: '0.0.0.0', // Listen on all network interfaces
allowedHosts: true, // Allow all hosts
proxy: {
// Proxy API requests to backend during development
// Use API_PROXY_TARGET for server-side proxy (not VITE_ prefix, so not exposed to browser)
'/api': {
target: process.env.API_PROXY_TARGET || 'http://localhost:3000',
changeOrigin: true,
secure: false
}
}
},
test: {
environment: 'node',
globals: true,
testTimeout: 30000,
// Exclude backend plugin unit tests (they use better-sqlite3 which causes worker fork errors)
// These are replaced by integration tests in tests/integration/
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/*.config.*',
'backend/src/plugins/*.test.js'
],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
reportsDirectory: './coverage',
include: ['src/**/*.{js,jsx}'],
exclude: ['**/*.test.js', '**/node_modules/**']
}
}
})