firq-dev-website/unlighthouse.config.ts
2025-04-11 22:46:38 +02:00

43 lines
1.1 KiB
TypeScript

export default async () => {
const sitemap = await (await fetch('http://website:8081/sitemap-0.xml')).text()
const urls = sitemap.match(/<loc>(.*?)<\/loc>/g)!.map(
(loc) => loc.replace(/<\/?loc>/g, '').replace(/https:\/\/firq.dev/g, 'http://website:8081')
)
return {
lighthouseOptions: {
cache: false,
throttlingMethod: 'devtools',
throttling: {
cpuSlowdownMultiplier: 4,
requestLatencyMs: 150,
downloadThroughputKbps: 1638.4,
uploadThroughputKbps: 1638.4,
},
screenEmulation: {
width: 412,
height: 823,
deviceScaleFactor: 1.75,
},
lighthouseConfig: {
skipAudits: ['is-on-https', 'redirects-http', 'uses-http2'],
},
},
puppeteerOptions: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
},
puppeteerClusterOptions: {
maxConcurrency: 1
},
ci: {
budget: 50,
buildStatic: true,
},
scanner: {
sitemap: true,
dynamicSampling: false,
samples: 3,
},
outputPath: 'unlighthouse-reports',
urls
}
}