-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvite.config.ts
More file actions
43 lines (41 loc) · 1.1 KB
/
vite.config.ts
File metadata and controls
43 lines (41 loc) · 1.1 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
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [react()],
base: env.VITE_BASE_URL || '/',
server: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
proxy: {
'/wasm': {
target: 'http://localhost:3000',
changeOrigin: true,
}
}
},
optimizeDeps: {
exclude: ['@wasmer/sdk']
},
build: {
rollupOptions: {
output: {
entryFileNames: 'index.mjs',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
manualChunks: {
wasmer: ['@wasmer/sdk'],
react: ['react', 'react-dom'],
xterm: ['xterm', 'xterm-addon-fit'],
addons: ['@xterm/addon-search', '@xterm/addon-clipboard', '@xterm/addon-web-links'],
elkjs: ['elkjs'],
},
},
},
},
}
})