Lighthouse
A separate Chrome via chrome-launcher (not Playwright — requires an installed Chrome). N runs per URL, per-metric aggregation: median (default) / p75 / best — a single run is ±10 points of noise. Metrics: performance, seo, accessibility, bestPractices, lcp, cls, tbt + the LCP element with a suggestion. Thresholds are route patterns and become regular error issues (→ exit 1). Results land in Report.lighthouse; diff compares by (url-pattern, metric) — a metric regression between branches is visible. formFactor: 'mobile' also sets the crawler viewport to 375×812 unless crawl.viewport is set.
Run it once per release, not on every PR: keep lighthouse.enabled: false in the base config and enable it in a profile — profiles: { release: { lighthouse: { enabled: true } } }, then ranklint lighthouse --url https://example.com --profile release on a tag (GitLab: RANKLINT_PROFILE on .ranklint-lighthouse; GitHub: input lighthouse-profile).
Which URLs are measured
By default — the first pages that answered 200 during the crawl, up to maxUrls (5). To pin the set, list paths or absolute URLs in lighthouse.urls: exactly they are measured, in that order, whether or not the crawl reached them. Paths resolve against --url; maxUrls, if set, still caps the list; an empty urls: [] counts as not set. The lighthouse command also measures urls instead of --url itself.
export default defineRanklintConfig({
site: { url: 'https://example.com' },
lighthouse: {
enabled: true,
urls: ['/', '/pricing', '/en/blog/'],
},
})
Profiles and one-off Lighthouse
profiles are patched over the base config with --profile <name> (defu). Keep Lighthouse off in the regular PR audit and enable it in a release profile that runs on tags or manually:
export default defineRanklintConfig({
site: { url: 'https://example.com' },
lighthouse: { enabled: false },
profiles: {
uat: { site: { url: 'https://uat.example.com' } },
release: { lighthouse: { enabled: true, runs: 5, thresholds: { '/**': { performance: 85 } } } },
},
})
ranklint audit --url https://uat.example.com --profile uat # every PR, seconds
ranklint lighthouse --url https://example.com --profile release # after a release
In the GitLab preset set RANKLINT_PROFILE: release on a job extending .ranklint-lighthouse with rules: [{ if: $CI_COMMIT_TAG }]; in the GitHub preset pass lighthouse-profile: release.