Passing a config
1
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
2
Pass the config to Lighthouse
Use the
--config-path flag when running from the CLI, or pass the config as the third argument when using the Node API.- CLI
- Node API
Config properties
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:
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.
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.
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:
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