- 新增 ARB Sepolia + BNB Testnet 多链支持 - 添加 LendingPanel 借贷系统组件 - 添加 LendingAdminPanel 管理面板 - 添加 USDCPanel USDC 操作组件 - 添加 HoldersPanel 持有人信息组件 - 添加 AutoTestPanel 自动化测试组件 - 重构 LP 组件为模块化结构 (LP/) - 添加多个调试和测试脚本 - 修复 USDC 精度动态配置 - 优化合约配置支持多链切换 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 50001,
|
|
host: '0.0.0.0',
|
|
strictPort: true,
|
|
allowedHosts: ['maxfight.vip', 'localhost', '127.0.0.1'],
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3003',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '/api')
|
|
}
|
|
}
|
|
},
|
|
// 优化依赖预构建
|
|
optimizeDeps: {
|
|
include: [
|
|
'wagmi',
|
|
'viem',
|
|
'viem/actions',
|
|
'viem/chains',
|
|
'@tanstack/react-query',
|
|
'react',
|
|
'react-dom',
|
|
'react-i18next',
|
|
'i18next',
|
|
],
|
|
// 强制预构建这些依赖,避免动态导入问题
|
|
esbuildOptions: {
|
|
target: 'esnext',
|
|
},
|
|
},
|
|
// 解析配置
|
|
resolve: {
|
|
alias: {
|
|
// 解决 viem 动态导入问题
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// React 相关
|
|
'react-vendor': ['react', 'react-dom'],
|
|
// Web3 相关
|
|
'web3-vendor': ['wagmi', 'viem', '@tanstack/react-query'],
|
|
// WalletConnect 相关
|
|
'walletconnect': [
|
|
'@web3modal/wagmi',
|
|
'@walletconnect/ethereum-provider',
|
|
],
|
|
// i18n
|
|
'i18n': ['react-i18next', 'i18next', 'i18next-browser-languagedetector'],
|
|
},
|
|
},
|
|
},
|
|
// 提高 chunk 大小警告阈值
|
|
chunkSizeWarningLimit: 600,
|
|
},
|
|
})
|