-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
62 lines (56 loc) · 1.58 KB
/
vite.config.js
File metadata and controls
62 lines (56 loc) · 1.58 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
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
export default defineConfig({
plugins: [preact()], // Enable Preact support for DevTools components
// Development server configuration
server: {
port: 5555,
host: true,
open: '/test-devtools.html',
cors: true,
headers: {
// Aggressive cache-busting for DevTools development
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
}
},
// Build configuration (if needed)
build: {
// Keep this simple since we're mainly using this for dev
outDir: 'dist',
minify: false,
sourcemap: true
},
// Configure how files are resolved
resolve: {
alias: {
// Make sure imports work correctly
'@': new URL('./', import.meta.url).pathname,
'@devtools': new URL('./devtools/src', import.meta.url).pathname,
// Preact/React compatibility for Evergreen UI
'react': 'preact/compat',
'react-dom': 'preact/compat'
}
},
// Ensure proper MIME types and static file serving (excluding .js which should be processed as modules)
assetsInclude: ['**/*.json', '**/*.html'],
// Optimizations
optimizeDeps: {
include: [
// Pre-bundle these for faster dev server startup
'preact',
'preact/hooks',
'preact/compat',
'evergreen-ui',
'lodash.merge'
]
},
// Define for development
define: {
'import.meta.env.DEV_SERVER': '"vite"',
'process.env.NODE_ENV': '"development"',
'process.browser': 'true',
'global': 'globalThis'
}
});