Repository navigation
Expand file tree
/
Copy pathvite.config.js
More file actions
64 lines (62 loc) · 1.89 KB
/
Copy pathvite.config.js
File metadata and controls
64 lines (62 loc) · 1.89 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
/* eslint-env node */
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [
tailwindcss(),
react(),
nodePolyfills({
// Ponytail: Only include exactly what Ethers v6 and Stellar SDK need.
include: ['buffer', 'process', 'stream', 'util'],
globals: {
Buffer: true,
global: true,
process: true,
},
}),
],
assetsInclude: ['**/*.splinecode'],
define: {
'import.meta.env.VITE_ADMIN_URL': JSON.stringify(env.ADMIN_URL),
'import.meta.env.VITE_ADMIN_PASS': JSON.stringify(env.ADMIN_PASS),
'import.meta.env.VITE_STELLAR_TREASURY_SECRET': JSON.stringify(env.STELLAR_TREASURY_SECRET),
global: 'globalThis'
},
server: {
proxy: {
'/sarvam-api': {
target: 'https://api.sarvam.ai',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/sarvam-api/, ''),
},
'/soroban-rpc': {
target: 'https://stellar-soroban-testnet-public.nodies.app',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/soroban-rpc/, ''),
configure: (proxy, _options) => {
proxy.on('proxyReq', (proxyReq, _req, _res) => {
proxyReq.removeHeader('referer');
proxyReq.removeHeader('origin');
});
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
chunkSizeWarningLimit: 3500,
},
}
})