firq-dev-website/unlighthouse.config.ts

42 lines
1 KiB
TypeScript
Raw Normal View History

2025-02-06 19:31:18 +01:00
export default async () => {
2025-04-08 20:44:47 +02:00
const sitemap = await (await fetch('http://website:8081/sitemap-0.xml')).text()
2025-02-06 19:31:18 +01:00
const urls = sitemap.match(/<loc>(.*?)<\/loc>/g)!.map(
2025-04-08 20:44:47 +02:00
(loc) => loc.replace(/<\/?loc>/g, '').replace(/https:\/\/firq.dev/g, 'http://website:8081')
2025-02-06 19:31:18 +01:00
)
return {
2024-10-23 00:20:44 +02:00
lighthouseOptions: {
2025-02-06 19:31:18 +01:00
throttlingMethod: 'devtools',
throttling: {
cpuSlowdownMultiplier: 4,
requestLatencyMs: 150,
downloadThroughputKbps: 1638.4,
uploadThroughputKbps: 1638.4,
},
screenEmulation: {
width: 412,
height: 823,
deviceScaleFactor: 1.75,
},
2025-04-08 21:15:42 +02:00
lighthouseConfig: {
settings: {
skipAudits: ['is-on-https', 'redirects-http'],
},
},
2024-10-23 00:20:44 +02:00
},
2023-07-08 23:44:31 +02:00
puppeteerOptions: {
2025-02-06 19:31:18 +01:00
args: ['--no-sandbox', '--disable-setuid-sandbox'],
2023-07-08 23:44:31 +02:00
},
2023-07-08 23:52:47 +02:00
ci: {
2025-02-06 19:31:18 +01:00
budget: 50,
buildStatic: true,
2023-07-08 23:52:47 +02:00
},
2024-10-21 22:36:12 +02:00
scanner: {
2025-02-06 19:31:18 +01:00
sitemap: true,
dynamicSampling: false,
samples: 3,
2024-10-21 22:36:12 +02:00
},
2025-02-06 19:31:18 +01:00
outputPath: 'unlighthouse-reports',
urls
}
2023-07-08 23:52:47 +02:00
}