forked from npmx-dev/npmx.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.lighthouserc.cjs
More file actions
51 lines (47 loc) · 1.2 KB
/
.lighthouserc.cjs
File metadata and controls
51 lines (47 loc) · 1.2 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
const fs = require('fs')
// Auto-detect Chrome executable path
function findChrome() {
const paths = [
// Linux
'/usr/bin/google-chrome-stable',
'/usr/bin/google-chrome',
'/usr/bin/chromium-browser',
// macOS
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
// Windows
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
]
for (const p of paths) {
if (fs.existsSync(p)) return p
}
return undefined
}
module.exports = {
ci: {
collect: {
startServerCommand: 'pnpm preview',
startServerReadyPattern: 'Listening',
url: [
'http://localhost:3000/',
'http://localhost:3000/search?q=nuxt',
'http://localhost:3000/nuxt',
],
numberOfRuns: 1,
chromePath: findChrome(),
puppeteerScript: './lighthouse-setup.cjs',
settings: {
onlyCategories: ['accessibility'],
skipAudits: ['valid-source-maps'],
},
},
assert: {
assertions: {
'categories:accessibility': ['error', { minScore: 1 }],
},
},
upload: {
target: 'temporary-public-storage',
},
},
}