sync: 同步 monkey-ai@weiyuan(ddc5b9443) 的 web/ 到 ui-optimization
- 合入 weiyuan 新功能前端:分佣 V2 / 伙伴工作台、智能路由、企业资金与分析、官网设置与预约演示等, semi-ui 已全部迁移到 antd 6 / @/components/ui,不重新引入 Semi - 分佣二级菜单与页头去重、伙伴入口探测(企业伙伴走企业中心「企业分佣」)、超管侧栏入口恢复 - 适配层 DatePicker / TimePicker 统一 onChange(Date|Date[]|null, 文本) 契约;生产构建剔除调试日志 - 图片链接刷新:同任务请求复用、后台刷新不弹全局错误、离页停止批量请求 - 恢复 bun.lock(与 package-lock.json 共存);docs 规范与 CHANGELOG 更新 - 停止跟踪 .env.playwright.local(本地登录凭据,已加入 .gitignore)
This commit is contained in:
+24
-2
@@ -20,6 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import path from 'node:path';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig, loadEnv, transformWithEsbuild } from 'vite';
|
||||
import legacyCssLayers from './vite-plugin-legacy-css-layers.js';
|
||||
|
||||
/**
|
||||
* 未配置代理变量时保留原有联调地址,兼容自定义 mode。
|
||||
@@ -92,18 +93,39 @@ function analyticsPlugin(env) {
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
export default defineConfig(({ mode, command }) => {
|
||||
const env = loadEnv(mode, __dirname, ['VITE_', 'DEV_PROXY_']);
|
||||
const proxyTarget = env.DEV_PROXY_TARGET || DEV_PROXY_TARGET;
|
||||
|
||||
return {
|
||||
// 生产构建剔除调试日志:在 esbuild 压缩阶段把 console.log/info/debug/trace 标为纯调用并删除,
|
||||
// 同时去掉 debugger;保留 console.warn/error 便于线上排障。作用于全部产物(含 jsxInJsPlugin
|
||||
// 处理的 src/*.js),开发服务不受影响。
|
||||
esbuild:
|
||||
command === 'build'
|
||||
? {
|
||||
drop: ['debugger'],
|
||||
pure: [
|
||||
'console.log',
|
||||
'console.info',
|
||||
'console.debug',
|
||||
'console.trace',
|
||||
],
|
||||
}
|
||||
: undefined,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
'~': path.resolve(__dirname, 'node_modules'),
|
||||
},
|
||||
},
|
||||
plugins: [jsxInJsPlugin(), react(), analyticsPlugin(env)],
|
||||
plugins: [
|
||||
jsxInJsPlugin(),
|
||||
react(),
|
||||
analyticsPlugin(env),
|
||||
// 旧内核(< Chromium 99)@layer 兜底,仅 build 生效(b7bac50b5)
|
||||
legacyCssLayers(),
|
||||
],
|
||||
optimizeDeps: {
|
||||
// Scan the app entry only; generated HTML reports are not app entries.
|
||||
entries: ['index.html'],
|
||||
|
||||
Reference in New Issue
Block a user