perf(build): 优化开发预热与首屏分包懒加载

减少应用启动时的静态依赖,增加首屏体积预算与懒加载边界校验。验证通过:875 项单测、UI 依赖审计、ESLint、Prettier、生产构建与首屏产物校验;Chrome 模拟回归通过。
This commit is contained in:
zhanjunhao
2026-11-20 15:03:30 +08:00
parent c925eef44c
commit fd34f60578
14 changed files with 161 additions and 33 deletions
+4 -3
View File
@@ -20,10 +20,10 @@ import React, {
useCallback,
} from 'react';
import { Button } from '@/components/ui';
import { API, showError } from '../../helpers';
import { API } from '../../helpers/api';
import { showError } from '../../helpers/utils';
import { StatusContext } from '../../context/Status';
import { useActualTheme } from '../../context/Theme';
import { marked } from 'marked';
import { useTranslation } from 'react-i18next';
import { Link, useNavigate } from 'react-router-dom';
import {
@@ -80,7 +80,8 @@ const Home = () => {
const { success, message, data } = res.data;
if (success) {
let content = data;
if (!isUrl(data)) {
if (data !== '' && !isUrl(data)) {
const { marked } = await import('marked');
content = marked.parse(data);
}
setHomePageContent(content);