-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
51 lines (50 loc) · 1.13 KB
/
vite.config.ts
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
import path from 'path'
import react from '@vitejs/plugin-react-swc'
import wasm from 'vite-plugin-wasm'
import svgr from 'vite-plugin-svgr'
import topLevelAwait from 'vite-plugin-top-level-await'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import { defineConfig } from 'vite'
import mdx from '@mdx-js/rollup'
import remarkGfm from 'remark-gfm'
export default defineConfig({
plugins: [
wasm(),
topLevelAwait(),
mdx({
remarkPlugins: [remarkGfm],
}),
react(),
svgr(),
nodePolyfills({
include: ['buffer'],
globals: {
Buffer: true, // can also be 'build', 'dev', or false
global: true,
},
}),
],
build: {
chunkSizeWarningLimit: 2000,
sourcemap: false,
minify: true,
},
resolve: {
alias: {
src: path.resolve(__dirname, './src'),
},
},
optimizeDeps: {
exclude: ['@electric-sql/pglite'],
},
worker: {
format: 'es',
},
base: process.env.VITE_BASE_URL || '/NoLLMChat/',
server: {
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
},
},
})