diff --git a/package.json b/package.json index 9d2038d..97bff6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@firq/fgosite", "type": "module", - "version": "0.2.0-pre.60", + "version": "0.2.0-pre.61", "private": true, "scripts": { "dev": "astro dev", diff --git a/unlighthouse.config.ts b/unlighthouse.config.ts index 6f7d007..39629af 100644 --- a/unlighthouse.config.ts +++ b/unlighthouse.config.ts @@ -1,32 +1,36 @@ -export default { +export default async () => { + const sitemap = await (await fetch('http://localhost:8081/sitemap-0.xml')).text() + const urls = sitemap.match(/(.*?)<\/loc>/g)!.map( + (loc) => loc.replace(/<\/?loc>/g, '').replace(/https:\/\/firq.dev/g, 'http://localhost:8081') + ) + return { lighthouseOptions: { - throttlingMethod: "devtools", - throttling: { - cpuSlowdownMultiplier: 4, - requestLatencyMs: 150, - downloadThroughputKbps: 1638.4, - uploadThroughputKbps: 1638.4, - }, - screenEmulation: { - width: 412, - height: 823, - deviceScaleFactor: 1.75, - } + throttlingMethod: 'devtools', + throttling: { + cpuSlowdownMultiplier: 4, + requestLatencyMs: 150, + downloadThroughputKbps: 1638.4, + uploadThroughputKbps: 1638.4, + }, + screenEmulation: { + width: 412, + height: 823, + deviceScaleFactor: 1.75, + }, }, puppeteerOptions: { - args: [ - "--no-sandbox", - "--disable-setuid-sandbox" - ], + args: ['--no-sandbox', '--disable-setuid-sandbox'], }, ci: { - budget: 50, - buildStatic: true, + budget: 50, + buildStatic: true, }, scanner: { - sitemap: true, - dynamicSampling: false, - samples: 3, + sitemap: true, + dynamicSampling: false, + samples: 3, }, - outputPath: "unlighthouse-reports", + outputPath: 'unlighthouse-reports', + urls + } }