perf(build): 优化开发预热与首屏分包懒加载
减少应用启动时的静态依赖,增加首屏体积预算与懒加载边界校验。验证通过:875 项单测、UI 依赖审计、ESLint、Prettier、生产构建与首屏产物校验;Chrome 模拟回归通过。
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
|
||||
const AgreementModal = lazy(
|
||||
() => import('../common/DocumentRenderer/AgreementModal'),
|
||||
);
|
||||
|
||||
export default function LazyAgreementModal(props) {
|
||||
if (!props.type) return null;
|
||||
|
||||
return (
|
||||
<Suspense fallback={null}>
|
||||
<AgreementModal {...props} />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ import GlassCard from './GlassCard';
|
||||
import AuthCardHeader from './AuthCardHeader';
|
||||
import AuthLoginTabs from './AuthLoginTabs';
|
||||
import AuthDivider from './AuthDivider';
|
||||
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
|
||||
import AgreementModal from './LazyAgreementModal';
|
||||
import {
|
||||
isMiniProgramWebView,
|
||||
withMiniProgramLogins,
|
||||
|
||||
@@ -48,7 +48,7 @@ import AuthCardHeader from './AuthCardHeader';
|
||||
import AuthLoginTabs from './AuthLoginTabs';
|
||||
import AuthDivider from './AuthDivider';
|
||||
import { Shield, Smartphone, QrCode } from 'lucide-react';
|
||||
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
|
||||
import AgreementModal from './LazyAgreementModal';
|
||||
import {
|
||||
isMiniProgramWebView,
|
||||
withMiniProgramLogins,
|
||||
|
||||
Reference in New Issue
Block a user