fixed unlighthouse 8

This commit is contained in:
Firq 2025-04-11 23:27:57 +02:00
parent ae98709260
commit 02d5af5a2d
Signed by: Firq
GPG key ID: DCE182BA39C697B2
3 changed files with 13 additions and 8 deletions

View file

@ -1,8 +1,13 @@
export default async () => {
const sitemap = await (await fetch('http://website:8081/sitemap-0.xml')).text()
/* fetch sitemap from debug container */
const sitemap = await (await fetch('http://website:8081/sitemap-0.xml')).text();
/* format URLs to work with debug container */
const urls = sitemap.match(/<loc>(.*?)<\/loc>/g)!.map(
(loc) => loc.replace(/<\/?loc>/g, '').replace(/https:\/\/firq.dev/g, 'http://website:8081')
)
);
/* ensure serve is already "warm", preventing startup lag that reduces performance */
for (const url of urls) { await fetch(url) };
/* actual config */
return {
lighthouseOptions: {
cache: false,