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
Copy file name to clipboardexpand all lines: docs/configuration.md
+2-73
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,3 @@
1
-
<!---
2
-
TODO(rm-legacy): Remove this when legacy path is gone.
3
-
-->
4
-
> **WARNING**: This config format is for configs in version 10.0 and beyond. Please read the [legacy config](#legacy-configs) section if you are using the old config format.
5
-
6
1
# Lighthouse Configuration
7
2
8
3
The Lighthouse config object is the primary method of customizing Lighthouse to suit your use case. Using a custom config, you can limit the audits to run, add additional loads of the page under special conditions, add your own custom checks, tweak the scoring, and more.
@@ -178,7 +173,7 @@ The groups property controls how to visually group audits within a category. For
178
173
179
174
## Config Extension
180
175
181
-
The stock Lighthouse configurations can be extended if you only need to make small tweaks, such as adding an audit or skipping an audit, but wish to still run most of what Lighthouse offers. When adding the `extends: 'lighthouse:default'` property to your config, the default passes, audits, groups, and categories will be automatically included, allowing you modify settings or add additional audits to a pass.
176
+
The stock Lighthouse configurations can be extended if you only need to make small tweaks, such as adding an audit or skipping an audit, but wish to still run most of what Lighthouse offers. When adding the `extends: 'lighthouse:default'` property to your config, the artifacts, audits, groups, and categories will be automatically included, allowing you modify settings or add additional audits and artifacts.
182
177
183
178
Please note that the `extends` property only supports extension of `lighthouse:default`. Other internal configs found in the [core/config](https://github.com/GoogleChrome/lighthouse/tree/main/core/config) directory can be used by importing the config object from file reference, or by using the [`--preset`](https://github.com/GoogleChrome/lighthouse#cli-options) CLI flag.
184
179
@@ -196,69 +191,3 @@ The best examples are the ones Lighthouse uses itself! There are several referen
Older versions of Lighthouse (pre-10.0) use a slightly different config format. The biggest difference is that the new configs do not include `passes`. If you want to load a page multiple times, we recommend creating a [user flow](https://github.com/GoogleChrome/lighthouse/blob/main/docs/user-flows.md).
The passes property controls how to load the requested URL and what information to gather about the page while loading. Each entry in the passes array represents one load of the page (e.g. 4 entries in `passes` will load the page 4 times), so be judicious about adding multiple entries here to avoid extending run times.
209
-
210
-
Each `passes` entry defines basic settings such as how long to wait for the page to load and whether to record a trace file. Additionally a list of **gatherers** to use is defined per pass. Gatherers can read information from the page to generate artifacts which are later used by audits to provide you with a Lighthouse report. For more information on implementing a custom gatherer and the role they play in building a Lighthouse report, refer to the [recipes](https://github.com/GoogleChrome/lighthouse/blob/main/docs/recipes/custom-audit). Also note that `artifacts.devtoolsLogs` will be automatically populated for every pass. Gatherers also have access to this data within the `afterPass` as `traceData.devtoolsLog` (However, most will find the higher-level `traceData.networkRecords` more useful).
211
-
212
-
For list of default pass values, see [our config constants](https://github.com/GoogleChrome/lighthouse/blob/main/core/config/constants.js).
213
-
214
-
#### Example
215
-
```js
216
-
{
217
-
passes: [
218
-
{
219
-
passName:'fastPass',
220
-
gatherers: ['fast-gatherer'],
221
-
},
222
-
{
223
-
passName:'slowPass',
224
-
recordTrace:true,
225
-
useThrottling:true,
226
-
networkQuietThresholdMs:5000,
227
-
gatherers: ['slow-gatherer'],
228
-
}
229
-
]
230
-
}
231
-
```
232
-
233
-
#### Options
234
-
| Name | Type | Description |
235
-
| -- | -- | -- |
236
-
| passName |`string`| A unique identifier for the pass used in audits and during config extension. |
237
-
| recordTrace |`boolean`| Records a [trace](https://github.com/GoogleChrome/lighthouse/blob/main/docs/architecture.md#understanding-a-trace) of the pass when enabled. Available to gatherers during `afterPass` as `traceData.trace` and to audits in `artifacts.traces`. |
238
-
| useThrottling |`boolean`| Enables throttling of the pass when enabled. |
239
-
| pauseAfterLoadMs |`number`| The number of milliseconds to wait after the load event before the pass can continue. Used to ensure the page has had time for post-load JavaScript to execute before ending a trace. (Default: 0) |
240
-
| networkQuietThresholdMs |`number`| The number of milliseconds since the last network request to wait before the page should be considered to have reached 'network quiet'. Used to ensure the page has had time for the full waterfall of network requests to complete before ending a trace. (Default: 5000) |
241
-
| pauseAfterNetworkQuietMs |`number`| The number of milliseconds to wait after 'network quiet' before the pass can continue. Used to ensure the page has had time for post-network-quiet JavaScript to execute before ending a trace. (Default: 0) |
242
-
| blockedUrlPatterns |`string[]`| URLs of requests to block while loading the page. Basic wildcard support using `*`. |
243
-
| gatherers |`string[]`| The list of gatherers to run on this pass. This property is required and on extension will be concatenated with the existing set of gatherers. |
244
-
245
-
### Migrating to 10.0 format
246
-
247
-
1. Combine the gatherer lists in [`config.passes`](#passes-object) into [`config.artifacts`](#artifacts-object), giving each artifact a unique ID.
248
-
1. Remove [`config.passes`](#passes-object) property. Pass properties such as `pauseAfterLoadMs` are defined on `config.settings` in 10.0 configs.
249
-
250
-
### Using legacy configs in 10.0
251
-
252
-
The old config format can still be used in 10.0 but it's behind a separate path in the CLI and Node API.
Copy file name to clipboardexpand all lines: docs/readme.md
-2
Original file line number
Diff line number
Diff line change
@@ -113,8 +113,6 @@ Lighthouse can run against a real mobile device. You can follow the [Remote Debu
113
113
114
114
You'll likely want to use the CLI flags `--screenEmulation.disabled --throttling.cpuSlowdownMultiplier=1 --throttling-method=provided` to disable any additional emulation.
115
115
116
-
> **Warning:** If you are running Lighthouse 10.x with any chrome version older than M112 (<=M111) you will need to add the `--legacy-navigation` to the `lighthouse` command. See https://github.com/GoogleChrome/lighthouse/issues/14746 for more info.
**Note**: when extending the default configuration file, passes with the same name are merged together, all other arrays will be concatenated, and primitive values will override the defaults.
24
+
**Note**: when extending the default configuration file, all arrays will be concatenated and primitive values will override the defaults.
0 commit comments