-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlighthouserc.js
More file actions
98 lines (84 loc) · 3.1 KB
/
lighthouserc.js
File metadata and controls
98 lines (84 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
* Lighthouse CI Configuration
* Automated performance, accessibility, and SEO audits
*
* Run with: npm run lighthouse
*/
module.exports = {
ci: {
collect: {
// Number of runs per URL (median is used)
numberOfRuns: 3,
// URLs to audit
url: [
'http://localhost:3000/',
'http://localhost:3000/judges',
'http://localhost:3000/courts',
'http://localhost:3000/search',
],
// Start local server before running audits
startServerCommand: 'npm run build && npm start',
startServerReadyPattern: 'Ready',
startServerReadyTimeout: 120000,
// Lighthouse settings
settings: {
preset: 'desktop',
throttling: {
rttMs: 40,
throughputKbps: 10240,
cpuSlowdownMultiplier: 1,
},
// Skip PWA audit (we're not a PWA yet)
skipAudits: ['installable-manifest', 'splash-screen', 'themed-omnibox'],
},
},
assert: {
// Performance budgets
assertions: {
// Core Web Vitals
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
'total-blocking-time': ['error', { maxNumericValue: 300 }],
'first-contentful-paint': ['error', { maxNumericValue: 1800 }],
'speed-index': ['error', { maxNumericValue: 3400 }],
interactive: ['error', { maxNumericValue: 3800 }],
// Performance Score
'categories:performance': ['warn', { minScore: 0.9 }],
// Accessibility (WCAG AA compliance)
'categories:accessibility': ['error', { minScore: 0.95 }],
// Best Practices
'categories:best-practices': ['warn', { minScore: 0.9 }],
// SEO
'categories:seo': ['error', { minScore: 0.95 }],
// Resource budgets
'resource-summary:document:size': ['warn', { maxNumericValue: 50000 }],
'resource-summary:script:size': ['warn', { maxNumericValue: 500000 }],
'resource-summary:stylesheet:size': ['warn', { maxNumericValue: 100000 }],
'resource-summary:image:size': ['warn', { maxNumericValue: 200000 }],
'resource-summary:font:size': ['warn', { maxNumericValue: 150000 }],
// Network requests
'resource-summary:script:count': ['warn', { maxNumericValue: 30 }],
'resource-summary:stylesheet:count': ['warn', { maxNumericValue: 10 }],
'resource-summary:third-party:count': ['warn', { maxNumericValue: 10 }],
// Specific audits
'uses-text-compression': 'error',
'uses-optimized-images': 'warn',
'modern-image-formats': 'warn',
'offscreen-images': 'warn',
'unused-javascript': 'warn',
'unused-css-rules': 'warn',
'uses-rel-preconnect': 'warn',
'uses-http2': 'error',
// Security
'is-on-https': 'error',
'uses-http2': 'error',
},
},
upload: {
// Store reports locally
target: 'filesystem',
outputDir: './lighthouse-reports',
reportFilenamePattern: '%%PATHNAME%%-%%DATETIME%%.report.%%EXTENSION%%',
},
},
}