Skip to content

Lighthouse Config

@theholocron/lighthouse-config provides a shared Lighthouse CI assertion configuration used across theholocron front-end projects.

Terminal window
pnpm add -D @theholocron/lighthouse-config

In your lighthouserc.cjs:

const { defaultAssertions, defineConfig } = require("@theholocron/lighthouse-config");
module.exports = defineConfig({
url: "http://localhost:4321",
startServerCommand: "pnpm preview",
assertions: {
...defaultAssertions,
// override individual assertions as needed
"largest-contentful-paint": ["error", { minScore: 0.8 }],
},
});

The bundled defaultAssertions warn on the following audits falling below 0.9 (or exceeding 0 bytes where applicable):

bf-cache, errors-in-console, font-display, label, largest-contentful-paint, lcp-lazy-loaded, non-composited-animations, prioritize-lcp-image, unused-javascript, uses-long-cache-ttl

The full API reference is generated from the package’s TSDoc comments.