2025-12-15 17:26:27 +00:00
|
|
|
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'],
|
2025-12-15 17:35:36 +00:00
|
|
|
},
|
|
|
|
|
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,
|
|
|
|
|
},
|
2025-12-15 17:26:27 +00:00
|
|
|
})
|