-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.js
More file actions
81 lines (68 loc) · 1.8 KB
/
vite.config.js
File metadata and controls
81 lines (68 loc) · 1.8 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
import { defineConfig } from 'vite';
export default defineConfig({
// Root directory for the project
root: '.',
// Public directory for static assets
publicDir: 'assets',
// Server configuration
server: {
port: 4035,
host: true, // Allow external connections
open: true, // Open browser automatically
cors: true, // Enable CORS for development
},
// Build configuration
build: {
outDir: 'dist',
assetsDir: 'assets',
sourcemap: true,
rollupOptions: {
input: {
main: 'index.html',
'map-browser': 'map-browser.html',
'map-creator': 'map-creator.html',
'map-export': 'map-export.html',
'map-inspector': 'map-inspector.html',
'map-information': 'map-information.html',
'map-export-layout': 'map-export-layout.html'
}
}
},
// Preview server configuration (for built files)
preview: {
port: 4035,
host: true,
open: true
},
// Asset handling
assetsInclude: ['**/*.geojson', '**/*.json'],
// Define global constants
define: {
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development')
},
// Vitest configuration
test: {
// Test environment
environment: 'node',
// Test file patterns
include: ['**/js/tests/**/*.test.js', '**/tests/**/*.test.js'],
// Exclude patterns
exclude: ['**/node_modules/**', '**/dist/**', '**/coverage/**'],
// Coverage configuration
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'js/tests/',
'dist/',
'coverage/',
'**/*.config.js'
]
},
// Test timeout
testTimeout: 10000,
// Globals (makes expect, describe, it available without imports)
globals: true
}
});