This is a gatsby plugin to check performance budget against all pages after build.
Install
npm install gatsby-performance-budget
Configuration
create budget.js
file at the root of your gatsby project and export the budget configuration as a module from it.
Example:
// budget.js
const budget = [
{
"resourceSizes": [
{
"resourceType": "script",
"budget": 300
},
{
"resourceType": "image",
"budget": 100
},
{
"resourceType": "third-party",
"budget": 200
},
{
"resourceType": "total",
"budget": 1000
}
]
}
]
module.exports = budget
Run
check-perf