Pulse · web performance
render-pulse
Find the CSS and JavaScript that block first paint in your built site, with the defer, async, media or critical-CSS fix for each.
npm i -D @mrlouiswright/render-pulsePublished to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).
What it checks
- Scriptsclassic
<script src>in<head>withoutdefer/async(high), synchronous external scripts in the middle of<body>,document.write(), scripts placed before stylesheets. - Stylesheetsgzip size of all render-blocking CSS per page against a budget (default 50 kB), too many blocking stylesheets,
@importin CSS files or inline styles, print stylesheets withoutmedia="print"… - Third partiesrender-blocking resources from other origins without
<link rel="preconnect">. - Knows the async patterns
media="print" onload="this.media='all'", module scripts, JSON-LD and template scripts are not reported.
Quick usage
CLI
npx render-pulse dist
npx render-pulse public --max-css-kb 30 --fail-on medium
npx render-pulse _site --format sarif > render.sarif
API
import { check, blocksRender } from "render-pulse";
blocksRender({ rel: "stylesheet", media: "print" }); // false
const report = check("dist", { maxCss: 30 * 1024 });
Every option is documented in the render-pulse docs.
CI / GitHub Action
permissions:
contents: read
security-events: write # only needed for the SARIF upload
jobs:
render-pulse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with: { persist-credentials: false }
- run: npm ci && npm run build # produce the static site first
- uses: MrLouisWright/render-pulse@v1
with:
path: dist
fail-on: high
sarif: render-pulse.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with: { sarif_file: render-pulse.sarif }