ci(other): cicd
Some checks failed
CI Build & Deploy / build-and-deploy-prod (push) Failing after 3m34s
CI Build & Deploy / build-and-deploy-dev (push) Has been cancelled

This commit is contained in:
2026-01-19 03:12:13 +08:00
commit 17230a9736
158 changed files with 20759 additions and 0 deletions

60
vite.config.js Normal file
View File

@@ -0,0 +1,60 @@
import { defineConfig, loadEnv } from 'vite'
import { convertEnv, getSrcPath, getRootPath } from './build/utils'
import { createVitePlugins } from './build/plugin'
import { OUTPUT_DIR, PROXY_CONFIG } from './build/constant'
export default defineConfig(({ command, mode }) => {
const srcPath = getSrcPath()
const rootPath = getRootPath()
const isBuild = command === 'build'
const env = loadEnv(mode, process.cwd())
const viteEnv = convertEnv(env)
const {
VITE_PORT,
VITE_PUBLIC_PATH,
VITE_USE_PROXY,
VITE_BASE_API,
VITE_ADMIN_API,
VITE_SENTRY,
} = viteEnv
// 调试代理配置
console.log('=== Vite代理配置调试 ===')
console.log('VITE_USE_PROXY:', VITE_USE_PROXY)
console.log('VITE_BASE_API:', VITE_BASE_API)
console.log('VITE_ADMIN_API:', VITE_ADMIN_API)
console.log('PROXY_CONFIG:', PROXY_CONFIG)
console.log('所有环境变量:', viteEnv)
return {
base: VITE_PUBLIC_PATH || '/',
resolve: {
alias: {
'~': rootPath,
'@': srcPath,
},
},
plugins: createVitePlugins(viteEnv, isBuild),
server: {
host: '0.0.0.0',
https: false,
port: VITE_PORT,
open: false,
proxy: {
'/api1': PROXY_CONFIG['/api1'],
'/api': PROXY_CONFIG['/api'],
'/admin1': PROXY_CONFIG['/admin1'],
'/admin': PROXY_CONFIG['/admin'],
},
},
build: {
target: 'es2015',
outDir: OUTPUT_DIR || 'dist',
reportCompressedSize: false, // 启用/禁用 gzip 压缩大小报告
chunkSizeWarningLimit: 1024, // chunk 大小警告的限制单位kb
sourcemap: VITE_SENTRY,
},
}
})