it kinda works. "Kinda" - meaning I can see the errors if perf-budget.json is invalid (like when I change any resourceType to "blabla" inside it), but passing a valid file here doesn't make any difference to any of the audits. For example, resource-summary still says:
{
id: 'resource-summary',
title: 'Keep request counts low and transfer sizes small',
description: 'To set budgets for the quantity and size of page ' +
'resources, add a budget.json file. [Learn ' +
'more](https://developers.google.com/web/tools/lighthouse/audits/budgets).',
Simply creating budget.json as description suggests doesn't work either.
Budget I'm trying to enforce is not a lot different from the one given in your examples:
Follow-up: Passing valid budgets in JSON.parse(fs.readFileSync('../perf-budget.json')) actually works because I see details table with sizeOverBudget value, but doesn't make performance-budget audit to fail.
Page Affected: https://developers.google.com/web/tools/lighthouse/audits/budgets
What needs to be done?
It's unclear on how to pass budgets into Lighthouse's Node module. I figured that passing
budgetPath
like so:doesn't work (so I guess documentation is missing something here), but if I provide an budgets like this:
it kinda works. "Kinda" - meaning I can see the errors if
perf-budget.json
is invalid (like when I change anyresourceType
to"blabla"
inside it), but passing a valid file here doesn't make any difference to any of the audits. For example,resource-summary
still says:Simply creating
budget.json
as description suggests doesn't work either.Budget I'm trying to enforce is not a lot different from the one given in your examples: