-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
73 lines (72 loc) · 1.58 KB
/
vite.config.ts
File metadata and controls
73 lines (72 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
63
64
65
66
67
68
69
70
71
72
73
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
import { Buffer } from 'buffer'
export default defineConfig({
plugins: [react()],
define: {
global: 'globalThis',
'process.env.NODE_DEBUG': '""',
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
'process.env.BROWSER': '"true"',
'process.browser': 'true',
'process.version': '""',
'process.versions': '{}',
'process.platform': '"browser"',
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
buffer: 'buffer',
crypto: 'crypto-browserify',
stream: 'stream-browserify',
process: 'process',
},
},
optimizeDeps: {
include: [
'buffer',
'process',
'crypto-browserify',
'stream-browserify',
'@lit-protocol/lit-node-client',
'@lit-protocol/encryption',
'@solana/web3.js',
'bs58'
],
exclude: [
'fs'
]
},
build: {
rollupOptions: {
external: ['fs', 'net', 'tls'],
input: {
main: resolve(__dirname, 'index.html'),
polyfills: resolve(__dirname, 'src/polyfills.ts'),
},
output: {
globals: {
buffer: 'Buffer',
}
}
},
outDir: 'dist',
assetsDir: 'assets',
// Ensure polyfills are properly included
commonjsOptions: {
transformMixedEsModules: true,
}
},
server: {
port: 3000,
host: '0.0.0.0',
open: true,
allowedHosts: true
},
preview: {
port: 4173,
host: '0.0.0.0',
allowedHosts: true
}
})