1. 交易历史记录功能 - 新增 useTransactionHistory hook 管理交易记录 - 新增 TransactionHistory 组件显示历史 - 交易记录保存到 localStorage 2. 错误处理和用户提示 - 新增 Toast 通知组件 - 交易提交/成功/失败时显示提示 - 解析并显示友好的错误信息 3. 打包优化 - 配置代码分割 (manualChunks) - 分离 react/web3/walletconnect/i18n - 提高 chunk 大小警告阈值 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
903 B
TypeScript
35 lines
903 B
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'],
|
|
},
|
|
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,
|
|
},
|
|
})
|