Passing a config
Create a config file
Create a JavaScript file that exports your config object. Most configs extend
lighthouse:default to inherit the full default set of audits, artifacts, and categories.custom-config.js
Config properties
| Property | Type | Description |
|---|---|---|
extends | string | undefined | Inherit from a built-in config. Only 'lighthouse:default' is supported. |
settings | Object | undefined | Control runtime options such as throttling and which audits to run. |
artifacts | Object[] | List of artifacts (data gathered from the page) to collect. |
audits | string[] | Audits to run against the collected artifacts. |
categories | Object | undefined | How to group and score audits in the report. |
groups | Object | undefined | Visual groupings of audits within a category. |
plugins | string[] | Plugin packages to include, which can add their own audits. |
extends
Setting extends: 'lighthouse:default' makes your config inherit the default artifacts, audits, groups, and categories. You can then add to or override only what you need.
extends only supports 'lighthouse:default'. To use other built-in presets such as perf, desktop, or experimental, use the --preset CLI flag or import the config file directly.settings
The settings object controls runtime behavior. The most commonly used options are:
| Option | Type | Description |
|---|---|---|
onlyCategories | string[] | Run only the specified categories. Additive with onlyAudits. Reduces total audit time. |
onlyAudits | string[] | Run only the specified audits. Additive with onlyCategories. Reduces total audit time. |
skipAudits | string[] | Exclude the specified audits. Takes priority over onlyCategories. Not usable alongside onlyAudits. |
artifacts
Artifacts are the raw data gathered from a page load. Each artifact is produced by a gatherer. On extension, artifacts are concatenated with the defaults.
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier used to reference this artifact in audits. |
gatherer | string | The gatherer module that produces this artifact. |
audits
The list of audit modules to run. Audits receive artifacts and produce scored results.
categories
Categories group audits and produce an overall score. Each category entry appears in the Lighthouse report with an aggregate score.
| Field | Type | Description |
|---|---|---|
title | string | Display name of the category. |
description | string | Description shown in the report. |
auditRefs | Object[] | Audits to include in this category. |
auditRefs[$i].id | string | The audit ID to include. |
auditRefs[$i].weight | number | Scoring weight for this audit within the category. |
auditRefs[$i].group | string (optional) | Display group ID for this audit. |
Many tools that consume Lighthouse do not need to group or score audit results. In those cases, omitting
categories is fine.groups
Groups control how audits are visually organized within a category in the report.
Built-in presets
Lighthouse ships with several preset configs you can use via the--preset CLI flag:
| Preset | Description |
|---|---|
perf | Runs only performance audits for faster results. |
desktop | Applies desktop viewport and scoring calibration instead of the default mobile emulation. |
experimental | Enables experimental audits not yet in the default config. |
Config extension
Config extension lets you build on the default Lighthouse setup with minimal boilerplate. Whenextends: 'lighthouse:default' is set, the default artifacts, audits, groups, and categories are automatically included. You only need to specify what you want to change.
custom-config.js