Migrate Lighthouse and Links Check
1 minute read
Migrate Lighthouse CI audits and broken links checking into this repository.
Context
SvelteKit's prerender crawler only validates internal links. External URLs (https://...) are silently discarded by is_root_relative() in the prerender loop — no handler, callback, or plugin hook ever sees them.
There is no built-in or planned feature for external link validation.
Approach
Use lychee (same as
timestripe) as a post-build link checker against the build/ output. Lychee is a fast Rust-based tool that checks both internal and
external links in HTML files.
- Install via
brew install lychee(local) and GitHub Action (CI) - Run against
./build/afterpnpm build - Add a
check:linksscript (notpostbuild— avoid slowing local dev) - Configure
.lychee.tomlfor excludes, timeouts, accepted status codes
Tasks
- Migrate Lighthouse CI configuration and scripts
- Add
lycheeas the broken links checker (replaces previous solution) - Add
.lychee.tomlconfig with sensible defaults - Add
check:linksscript topackage.json - Integrate both into the CI/CD pipeline (GitHub Actions)
Read next