You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,66 +51,6 @@ For more infos visit the [official docs](https://developer.chrome.com/docs/light
51
51
52
52
4. Run the CLI with `npx code-pushup collect` and view or upload the report (refer to [CLI docs](../cli/README.md)).
53
53
54
-
### Optionally set up categories
55
-
56
-
Reference audits (or groups) which you wish to include in custom categories (use `npx code-pushup print-config --onlyPlugins=lighthouse` to list audits and groups).
57
-
58
-
Assign weights based on what influence each Lighthouse audit has on the overall category score (assign weight 0 to only include as extra info, without influencing category score).
59
-
The plugin exports the helper `lighthouseAuditRef` and `lighthouseGroupRef` to reference Lighthouse category references for audits and groups.
60
-
61
-
#### Reference audits directly with `lighthouseGroupRef`
62
-
63
-
```ts
64
-
import { lighthouseGroupRef } from'./utils';
65
-
66
-
exportdefault {
67
-
// ...
68
-
categories: [
69
-
{
70
-
slug: 'performance',
71
-
title: 'Performance',
72
-
refs: [lighthouseGroupRef('performance')],
73
-
},
74
-
{
75
-
slug: 'a11y',
76
-
title: 'Accessibility',
77
-
refs: [lighthouseGroupRef('accessibility')],
78
-
},
79
-
{
80
-
slug: 'best-practices',
81
-
title: 'Best Practices',
82
-
refs: [lighthouseGroupRef('best-practices')],
83
-
},
84
-
{
85
-
slug: 'seo',
86
-
title: 'SEO',
87
-
refs: [lighthouseGroupRef('seo')],
88
-
},
89
-
],
90
-
};
91
-
```
92
-
93
-
#### Reference groups with `lighthouseAuditRef`
94
-
95
-
The Lighthouse categories are reflected as groups.
96
-
Referencing individual audits offers more granularity. However, keep maintenance costs of a higher number of audits in mind as well.
The Lighthouse plugin supports running audits against multiple URLs in a single invocation. To do this, provide an array of URLs as the first argument to the plugin:
@@ -148,63 +88,6 @@ export default {
148
88
};
149
89
```
150
90
151
-
### Categories with multiple URLs
152
-
153
-
When running Lighthouse against multiple URLs, use the `mergeLighthouseCategories` utility to ensure categories are correctly expanded and results are aggregated per URL.
If you provide custom categories, you can reference both groups and audits as usual. The merging utility will expand each referenced group or audit for every URL, assigning the correct per-URL weight.
>Weightsdetermineeachref's influence on the category score. Use weight `0` to include a ref as info only, without affecting the score.
262
+
263
+
> [!TIP]
264
+
>Youcanuse`lighthouseGroupRef`and`lighthouseAuditRef`directlyinyourcategorieswithoutthehelper. However, wrappingthemin`lighthouseCategories`future-proofsyourconfigformulti-URLsetups.
0 commit comments