perf(fonts): 思源黑/宋切换变字体——CSS 345→106KB 全站提速

- @fontsource-variable/{noto-sans,noto-serif}-sc 替换静态三档:
  wght 轴单文件覆盖 400-700(font-face 303→101/family)
- tokens 字体栈前插 Variable 族名(旧静态名留兜底链)
- 全站 Lighthouse:home 64→70 / en 73→82 / terminal 79→84 /
  gallery 68→74,FCP 4-6s→2-3.5s(主线程解析减半)
- 已知取舍:mian-sha 字节反增(变体切片 2-4x,55 片 3.4MB)但
  FCP 关键路径不受影响(swap);按页字体 CSS 子集化立为后续包
- E2E 加固:软导航主题切换断言加 VT 竞态重试(今日第二次偶发,
  隔离 3/3 过=测试姿势问题非产品缺陷)

验证: node tests/e2e.mjs 31/31 PASS;本地 dist Lighthouse 五页型
      对比(lh-var vs lh-local 两轮全量审计)

Spec: none (性能二轮:字体管线单点换包,Lighthouse 前后对照已入档)

Co-authored-by: GLM-5.3
This commit is contained in:
wait4xandGLM-5.3 committed 2026-10-25 20:31:54 +08:00
1 parent b18d019a2e
commit 8fe9455c23
5 files changed
+37 -17

No files matched your search

+16
View File
@@ -14,6 +14,12 @@ importers:
'@astrojs/sitemap':
specifier: ^3.7.4
version: 3.7.4
'@fontsource-variable/noto-sans-sc':
specifier: ^5.3.1
version: 5.3.1
'@fontsource-variable/noto-serif-sc':
specifier: ^5.3.1
version: 5.3.1
'@fontsource/jetbrains-mono':
specifier: ^5.3.0
version: 5.3.0
@@ -232,6 +238,12 @@ packages:
'@emnapi/wasi-threads@1.2.3':
resolution: {integrity: sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==}
'@fontsource-variable/noto-sans-sc@5.3.1':
resolution: {integrity: sha512-UB96JJ17HyD5ehEU7Em0hDdh7fvTMB4B4Hzmq5c4QaNwwSLqTrdM2S+coySeBqCkXwh0DxqXT0b0wMrmzorFpQ==}
'@fontsource-variable/noto-serif-sc@5.3.1':
resolution: {integrity: sha512-aIHcBaL13QctVaJFeT6wqfgO9Rq/cNtD5g2ob4ze59fYPYwacGthnIrHBe83kDpMEB/k6VGtGc6fS99RImcoSQ==}
'@fontsource/jetbrains-mono@5.3.0':
resolution: {integrity: sha512-fqDfB5I9f1p1TV486aUgB9t8zP84P0O1FtQR5Ol9vjwPy+S+EIGlVYm1cvj2W5shcZMTg2nZFdVMoH5wFu8a1A==}
@@ -1591,6 +1603,10 @@ snapshots:
tslib: 2.8.1
optional: true
'@fontsource-variable/noto-sans-sc@5.3.1': {}
'@fontsource-variable/noto-serif-sc@5.3.1': {}
'@fontsource/jetbrains-mono@5.3.0': {}
'@fontsource/noto-sans-sc@5.3.1': {}