Skip to content

Configuration Options

Alfredo Lopez edited this page Sep 2, 2019 · 12 revisions

This document describes all the configuration options you may configure in a Lightkeeper configuration file. Any config you define applies to the whole repository (e.g. if you have a monorepo).

Routes

An array of one or more URL routes.

Routes can be either a string, or an object. It can extend the baseURL, or use a separate domain if it begins with an http(s) scheme. Macros available:

URL Macros
Macro Details
{pr_number} The Pull Request Number.
{repo} A slugified repo name.
{branch} A slugified branch name.
{commit_hash} The full commit SHA.
{commit_hash:n} A trimmed SHA, where n is a digit.
*{target_url} The target url from the Github Response.
**{environment_url} The url from the Deployment status.

* Available for statuses and deployments.

** Available for deployments only.

Configuration object for routes:

Name Type(s) Description Required Default
url String The URL route
settings String / Object The shared settings name, or object Global settings

If settings is an object, it can extend a global or shared setting, and override properties on top.

Name Type(s) Description Default
extends Boolean / String The shared setting name, or true for global N/A

Settings

There are 4 available options:

  • categories Lighthouse Scores

    Name Type(s) Description
    performance Number / Object The Performance Score
    accessibility Number / Object The Accessibility Score
    best-practices Number / Object The Best Practices Score
    pwa Number / Object The Progressive Web App Score

    If the value is an object, it can have up to 3 options:

    Name Type Description Default
    target Number The score's target
    threshold Number A number that will subtracted from target
    warning Number A number added to threshold 25% of threshold
  • budgets - An array of LightWallet budgets (Resource Sizes, Resource Counts)

    Lightkeeper additions: threshold, warning for each budget. E.g:

     "resourceSizes": [
           {
             "resourceType": "script",
             "budget": 300,
             "threshold" : 100,
             "warning" : 20
           }
     ]

    For the above scenario, 400kb will pass and anything above 380kb will log a warning.

    For LightWallet budgets, threshold is added on top of budget since lower is better.

  • lighthouse The Lighthouse URL and options.

    Name Type Description Default Reserved
    url String The Lighthouse endpoint Lightkeeper
    options Object Lighthouse CLI options Lighthouse Defaults port, output, logLevel
    config Object Lighthouse configuration Lighthouse Full
    headers Object Optional headers for external Lighthouse endpoints
    puppeteerConfig Object The puppeteer configuration args, executablePath
  • If the Lighthouse endpoint is external:

    • The Github installation node is sent as an Authentication header by default
    • Optional headers are sent
    • All other properties outside of the reserved above are sent as a POST body.
  • reportOnly

    Type Description Default
    Boolean Controls if failures from this URL should fail the overall build false

Shared Settings

Key/value pairs of setting objects. sharedSettings is a single top-level property. extends can only be true to prevent recursion.

"sharedSettings" : {
    "my-custom-setting" : {
       "extends": true,
       "categories: {...}
    }
}
Clone this wiki locally