// lighthouserc.cjs: Lighthouse CI's settings. The pages and their limits come from budgets.json. const { pages } = require("./budgets.json"); const assertMatrix = Object.entries(pages).map(([path, limits]) => ({ matchingUrlPattern: `:\\d+${path}$`, aggregationMethod: "median", assertions: Object.fromEntries(Object.entries(limits).map(([id, limit]) => [id, ["error", { maxNumericValue: limit.max }]])), })); module.exports = { ci: { collect: { staticDistDir: "./site", url: Object.keys(pages).map((path) => `http://localhost${path}`), numberOfRuns: 5, }, assert: { assertMatrix, includePassedAssertions: true }, upload: { target: "filesystem", outputDir: "./lhci-reports" }, }, };