|
| 1 | +// https://github.com/GoogleChrome/budget.json |
| 2 | +{ |
| 3 | + "additionalProperties": false, |
| 4 | + "definitions": { |
| 5 | + "budget": { |
| 6 | + "properties": { |
| 7 | + "$schema": { |
| 8 | + "description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.", |
| 9 | + "type": "string" |
| 10 | + }, |
| 11 | + "path": { |
| 12 | + "description": "The `path` property indicates the pages that a budget applies to. This string should follow the [robots.txt](https://developers.google.com/search/reference/robots_txt#examples-of-valid-robotstxt-urls) format.\n\nIf `path` is not supplied, a budget will apply to all pages.\n\nIf a page's URL path matches the path property of more than one budget in `budget.json`, then the last matching budget will be applied. As a result, global budgets (e.g. `\"path\": \"/*\"`) should be listed first in `budget.json`, followed by the budgets that override the global budget (e.g. `\"path\": \"/blog\"`).\n\n**Examples**\n\nMatch all URL paths.\n`\"path\": \"/\"` (This is equivalent to writing `\"path\": \"/*\"`)\n\nMatch all URL paths starting with `/articles`.\n`\"path\": \"/articles\"`\n\nMatch URL paths within the `uk/` directory and ending with `shopping-cart`.\n\n`\"path\": \"/uk/*/shopping-cart$\"`", |
| 13 | + "type": "string" |
| 14 | + }, |
| 15 | + "resourceCounts": { |
| 16 | + "description": "This is an array of `resourceCountBudget` objects.", |
| 17 | + "items": { |
| 18 | + "$ref": "#/definitions/resourceCountBudget" |
| 19 | + }, |
| 20 | + "type": "array" |
| 21 | + }, |
| 22 | + "resourceSizes": { |
| 23 | + "description": "This is an array of `resourceSizeBudget` objects.", |
| 24 | + "items": { |
| 25 | + "$ref": "#/definitions/resourceSizeBudget" |
| 26 | + }, |
| 27 | + "type": "array" |
| 28 | + }, |
| 29 | + "resourceType": { |
| 30 | + "enum": ["document", "font", "image", "media", "other", "script", "stylesheet", "third-party", "total"], |
| 31 | + "type": "string" |
| 32 | + } |
| 33 | + }, |
| 34 | + "required": ["resourceType"], |
| 35 | + "type": "object" |
| 36 | + }, |
| 37 | + "resourceCountBudget": { |
| 38 | + "additionalProperties": false, |
| 39 | + "description": "A `resourceCountBudget` object consists of two required properties: `resourceType` and `budget`.", |
| 40 | + "properties": { |
| 41 | + "budget": { |
| 42 | + "description": "the number of requests", |
| 43 | + "type": "number" |
| 44 | + }, |
| 45 | + "resourceType": { |
| 46 | + "$ref": "#/definitions/resourceType" |
| 47 | + }}, |
| 48 | + "required": ["budget", "resourceType"], |
| 49 | + "type": "object" |
| 50 | + }, |
| 51 | + "resourceSizeBudget": { |
| 52 | + "additionalProperties": false, |
| 53 | + "description": "A `resourceSizeBudget` object contains two properties: `resourceType` and `budget`.", |
| 54 | + "properties": { |
| 55 | + "budget": { |
| 56 | + "description": "the _transfer size_ of a resource, in kilobytes", |
| 57 | + "type": "number" |
| 58 | + }, |
| 59 | + "resourceType": { |
| 60 | + "$ref": "#/definitions/resourceType" |
| 61 | + } |
| 62 | + }, |
| 63 | + "type": "object" |
| 64 | + }, |
| 65 | + "resourceType": { |
| 66 | + "description": "one of the [resource types](https://github.com/GoogleChrome/budget.json#resourcetype) supported by `budget.json`", |
| 67 | + "type": "string" |
| 68 | + } |
| 69 | + }, |
| 70 | + "description": "the format used by Lighthouse for declaring performance budgets", |
| 71 | + "items": { |
| 72 | + "$ref": "#/definitions/budget" |
| 73 | + }, |
| 74 | + "title": "Lighthouse budget", |
| 75 | + "type": "array" |
| 76 | +} |
0 commit comments