How to add custom weight for audit ref ids for categories #11735
-
Hi I am trying to add custom weight for audit ref ids in categories (performance) using a custom config js. I would like to calculate performance on custom weight instead of using the default lighthouse weight. I also observe after adding the below change , in the report all the audit ref duplicated. I am using lighthouse version 6. Below are the details of my custom config. module.exports = {
extends: 'lighthouse:default',
categories: {
performance: {
title: 'Performance',
description: 'This category judges your performance',
auditRefs: [
{id: 'total-blocking-time', weight: 10, group: 'metrics'},
{id: 'first-contentful-paint', weight: 20, group: 'metrics'},
{id: 'interactive', weight: 25, group: 'metrics'},
{id: 'speed-index', weight: 25, group: 'metrics'},
{id: 'largest-contentful-paint', weight: 5, group: 'metrics'},
{id: 'cumulative-layout-shift', weight: 15, group: 'metrics'}
],
}
}
}; Thanks & Regards |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
If you want your category to replace the default performance category, then you can't extend the default config. Extension for categories is additive. tl;dr remove |
Beta Was this translation helpful? Give feedback.
-
After removing the extends: 'lighthouse:default' I am getting error in pipeline.
Please guide me if i am missing any other configuration |
Beta Was this translation helpful? Give feedback.
-
Well yes that's not the only change to make, if you're not extending anymore but still want to use those audits you'll need to copy what you need from the default config. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response. |
Beta Was this translation helpful? Give feedback.
If you want your category to replace the default performance category, then you can't extend the default config. Extension for categories is additive.
tl;dr remove
extends: 'lighthouse:default'
if you want to replace a category.