Skip to content

docs: Lighthouse CI on Vercel preview deploys#3

Closed
havardljohansen wants to merge 3 commits into
frontkom:mainfrom
havardljohansen:docs/lighthouse-ci-nextjs
Closed

docs: Lighthouse CI on Vercel preview deploys#3
havardljohansen wants to merge 3 commits into
frontkom:mainfrom
havardljohansen:docs/lighthouse-ci-nextjs

Conversation

@havardljohansen
Copy link
Copy Markdown
Contributor

Summary

Adds docs/lighthouse-ci-nextjs.md — a copy-pasteable writeup for setting up Lighthouse CI on a Next.js app deployed on Vercel.

Requested in the #night-shift Slack thread (Per Andre: "Do you have a writeup or skill on how to set up Lighthouse CI on a Next project so I can replicate it on my side?").

What it covers

  • Two files (workflow + .lighthouserc.cjs) with inline comments explaining every non-obvious choice.
  • The five gotchas that bite first-time LHCI setups, each paired with the mitigation in this config:
    1. pull_request trigger races Vercel's preview build → use deployment_status
    2. GH-runner ±10pt variance → numberOfRuns: 3 + median
    3. PWA audits drag a non-PWA score → no lighthouse:no-pwa preset on day one
    4. Default URL list = / only → explicit urls array
    5. Auth pages can't be Lighthouse'd → public pages only
  • Optional Lighthouse CI GitHub App install for PR comments.
  • Tightening path: warnerror, add preset, make a required check.

Why a separate doc, not a manifest task

This is infrastructure setup — a one-time per-repo configuration. Once LHCI is running, the audit task PR #2 can consume its signal (or its own fresh runs). The doc explicitly frames itself as complementary to #2, not in competition.

Pilot reference

frontkom/merkur-frontend#94 is the working pilot the doc is genericized from.

Test plan

  • Manual review of the two code blocks against the merkur pilot — content matches, only urls placeholder + comments are genericized.
  • Per Andre tries it on his Next.js project (test-with-limited-scope as suggested in the thread).

havardljohansen and others added 3 commits May 6, 2026 09:54
Genericized writeup for setting up Lighthouse CI on a Next.js app on
Vercel, paired with the merkur-frontend pilot (PR #94). Captures the
five common gotchas (preview-build race, runner variance, PWA score
drag, single-URL coverage, auth/draft pages) and the pilot-week
"warn first, tighten later" approach.

Lands in docs/ next to roadmap.md so it's discoverable from the
contributor side. Closing section frames it as complementary to
Henrik's PR frontkom#2 (run-Lighthouse-from-task), not in competition: the
.lighthouserc.cjs page list is the same list improve-performance
would target if pointed at the repo.

Requested by Per Andre via #night-shift Slack thread.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The trigger (deployment_status) and the LHCI config are platform-level,
not framework-level. Title + intro were narrower than the actual content.
Same workflow applies to Astro, Remix, Nuxt, plain static, etc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Forgot to stage the content edit in the rename commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@havardljohansen havardljohansen changed the title docs: Lighthouse CI on a Next.js + Vercel project docs: Lighthouse CI on Vercel preview deploys May 6, 2026
@havardljohansen
Copy link
Copy Markdown
Contributor Author

Closing in favor of new PR opened from frontkom branch (write access granted by Per Andre, no longer need fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant