-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
40 lines (39 loc) · 1.03 KB
/
vite.config.js
File metadata and controls
40 lines (39 loc) · 1.03 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
import { defineConfig } from 'vite'
import path from 'path'
import webcontainerFilesPlugin from './.vite/plugins/webcontainer-files.tsx'
export default defineConfig({
// Suppress warnings about "use client" directives
build: {
rollupOptions: {
onwarn(warning, warn) {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE' &&
warning.message.includes('"use client"')) {
return
}
warn(warning)
}
},
// Increase chunk size limit to avoid too many warnings
chunkSizeWarningLimit: 800,
},
// Configure worker build
worker: {
format: 'es', // Use ES modules format instead of IIFE
},
optimizeDeps: {
exclude: ['@electric-sql/pglite'],
},
plugins: [webcontainerFilesPlugin()],
// Configure server headers for SharedArrayBuffer support
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
}
})