-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
56 lines (55 loc) · 1.33 KB
/
vite.config.js
File metadata and controls
56 lines (55 loc) · 1.33 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import path from 'path'
export default defineConfig({
plugins: [
react(),
tailwindcss(),
nodePolyfills({
globals: { Buffer: true, global: true, process: true },
protocolImports: true,
}),
],
// Esto asegura que "global" exista en el navegador, vital para librerías Web3
define: {
global: 'globalThis',
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
base: '/',
server: {
host: '127.0.0.1',
port: 5173,
strictPort: true,
cors: true,
proxy: {
// Recordatorio: Esto es SOLO para desarrollo local
'/api/binance': {
target: 'https://fapi.binance.com',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/api\/binance/, '/fapi/v1/klines')
}
}
},
build: {
outDir: 'dist',
emptyOutDir: true,
target: 'esnext', // Necesario para el Top-level await de algunas librerías de Pyth
chunkSizeWarningLimit: 1600,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor';
}
}
}
}
}
})