Reputation: 2928
Is it possible to configure the Core Web Vitals metrics thresholds during build time? or as part of your CI process?
Upvotes: 2
Views: 293
Reputation: 2928
The Core Web Vitals prescribe a specific set of metrics thresholds and percentiles we believe correspond well to user expectations across a range of devices.
We encourage using our official thresholds as much as possible. If however, you would like to set custom targets for thresholds (e.g a Largest Contentful Paint performance budget of < 3s), this is possible using Lighthouse CI and LightWallet. Metric targets can be set using assertions and a performance budgets file.
An example of such assertions can be found below:
{
"ci": {
"assert": {
"assertions": {
"largest-contentful-paint": ["warn", {"maxNumericValue": 3000}],
"viewport": "error",
"resource-summary:document:size": ["error", {"maxNumericValue": 14000}],
"resource-summary:font:count": ["warn", {"maxNumericValue": 1}],
"resource-summary:third-party:count": ["warn", {"maxNumericValue": 5}]
}
}
}
}
Upvotes: 1