Delightfully scan your entire website with Google Lighthouse. Navigate your performance, accessibility and SEO.
npm install unlighthouse-ciDedicated CI package for Unlighthouse that provides continuous integration capabilities with budget enforcement and exit codes.
``bashUse directly with npx
npx unlighthouse-ci --site https://example.com
Usage
$3
`bash
Run CI scan with default budget (75)
unlighthouse-ci --site https://example.comCustom performance budget
unlighthouse-ci --site https://example.com --budget 85Desktop scanning with custom output
unlighthouse-ci --site https://example.com --desktop --output-path ./lighthouse-reports
`$3
`yaml
name: Lighthouse CI
on: [push, pull_request]
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Lighthouse CI
run: npx unlighthouse-ci --site ${{ secrets.SITE_URL }} --budget 80
`$3
- Performance budget enforcement with configurable thresholds
- Exit codes for CI/CD pipeline integration
- Static report generation for hosting
- Comprehensive logging and debugging
- Support for custom Lighthouse configurations
Configuration
Create
unlighthouse.config.ts for advanced CI configuration:`ts
import { defineUnlighthouseConfig } from 'unlighthouse/config'export default defineUnlighthouseConfig({
site: 'https://example.com',
ci: {
budget: 80,
buildStatic: true,
},
lighthouseOptions: {
onlyCategories: ['performance', 'accessibility', 'seo'],
}
})
``- CI Integration Guide
- GitHub Actions Example
- Configuration Reference
MIT License © 2021-PRESENT Harlan Wilton