#!/usr/bin/env node /** * 首页 render-blocking CSS 内联(车道 D):把 dist/index.html 唯一的阻塞样式表 * (BaseLayout 共享块,~11KB)内联进
。 * 慢模式双峰根因不在 css(实测:字体子集也内联后 6.0s 模式反成主流), * 本脚本只保留 BaseLayout 内联这一确定性收益(省一次发现+下载跳)。 */ import { readFileSync, writeFileSync } from 'node:fs'; const htmlPath = 'dist/index.html'; let html; try { html = readFileSync(htmlPath, 'utf8'); } catch { console.error('[inline-home-css] dist/index.html 不存在,跳过'); process.exit(0); } const m = html.replace(/