Lighthouse scores vary between runs due to network conditions and CPU load. These techniques improve consistency.
Run Lighthouse multiple times and average the results for better accuracy:
import { defineUnlighthouseConfig } from 'unlighthouse/config'
export default defineUnlighthouseConfig({
scanner: {
samples: 3, // Run 3 scans per URL and average results
},
})
Limit concurrent workers to reduce CPU contention and improve score consistency:
import { defineUnlighthouseConfig } from 'unlighthouse/config'
export default defineUnlighthouseConfig({
puppeteerClusterOptions: {
maxConcurrency: 1, // Single worker for maximum accuracy
},
})