Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 3.05 KB

configuration.md

File metadata and controls

78 lines (61 loc) · 3.05 KB

Configuration

A configuration file must be specified when using lighthouse-inspector.

sample-config.json

{
	"pages": [
		"https://google.com/"
	],
	"expectations": {
		"categories": {
			"pwa": 90,
			"best-practices": 90,
			"performance": 90,
			"accessibility": 90
		},
		"audits": {
			"first-meaningful-paint": 30,
			"load-fast-enough-for-pwa": true
		}
	},
	"lighthouseParams": {
		"flags": {
		  "chromeFlags": ["--headless"]
		},
		"config": {
		  "extends": "lighthouse:default"
		}
	}
}

CLI

lighthouse-inspector --config /path/to/config

Properties

Name Type
pages string[]
expectations Object
lighthouseParams Object|undefined
failOnUnmetExpectation boolean

pages: string[]

The pages property specifies a set of URLs to inspect with Lighthouse. At least one URL must be specified.

expectations: Object

The expectations property specifies the expected score for certain Lighthouse categories and audits. The expected score for categories must be a number. The expected score for audits must be a number or a boolean. The categories and audits declared in the expectations object will be used to tell Lighthouse which categories and audits to test, by implicitly setting Lighthouse's configuration settings.onlyCategories and settings.onlyAudits (see Lighthouse settings property documentation).

Options

Name Type Description
categories Object An object where the key is the category id (as defined by the Lighthouse categories configuration), and the value is the expected score for that category.
audits Object An object where the key is the audit name (as defined by the Ligthouse audits configuration), and the value is the expected score for the audit.

lighthouseParams: Object

The lighthouseParams property specifies the flags and configuration for Lighthouse.

Options

Name Type Description
config Object A Lighthouse configuration object as specified in the Lightouse configuration file documentation. If settings.onlyCategories or settings.onlyAudits are set, the implicit configuration of these properties derived from the expectations object will be overriden.
flags Object An object containing Lighthouse flags, as specified in the Lighthouse CLI options.

failOnUnmetExpectation: boolean

The failOnUnmetExpectation property indicates whether the program will return with an error code when an expectation is unmet. Defaults to false.