-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (36 loc) · 1.08 KB
/
vite.config.ts
File metadata and controls
37 lines (36 loc) · 1.08 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import wasm from 'vite-plugin-wasm';
import topLevelAwait from 'vite-plugin-top-level-await';
// https://vitejs.dev/config/
export default defineConfig({
// GitHub Pages 部署时使用仓库名作为 base path
// CI 构建时通过 --base 参数传入,本地开发使用 '/'
base: '/',
plugins: [react(), tailwindcss(), wasm(), topLevelAwait()],
server: {
port: 3000,
open: true,
// Binance API 代理 (仅用于本地开发,解决 CORS 问题)
proxy: {
'/binance-spot': {
target: 'https://api.binance.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/binance-spot/, ''),
},
'/binance-futures': {
target: 'https://fapi.binance.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/binance-futures/, ''),
},
},
},
build: {
target: 'esnext',
},
optimizeDeps: {
// 排除 wasm 模块,避免预构建问题
exclude: ['quant_core'],
},
});