Where to place budget.json file in hugo build

currently I am building a project with hugo, but I wandted to optimise the performance of my project by adding a budget.json file into my build.

But does anyone know the right place to place the budget.json file? the current location of the budget.json file is the static folder inside my theme folder.

Seeing that lighthouse in my chrome brouwser is not picking up my budget file, I know that this is not the correct place, so if anyone can share a link to any resource or know the right locattion for the budget I would really love your feedback.

Your budget file can be a local one. Cf. Use Lighthouse for performance budgets

lighthouse https://example.com --budget-path=./budget.json

I don’t know of Chrome Browser doing budgets, only the command line as @nfriedli described works with budget files. I would put it into the root directory of your repository. I would also NOT make it part of the build process, but add it to some test setup.

If you run hugo server then everything is happening in RAM and Chrome won’t find your budget file. It might work if you run hugo and then have the budget file in static, so it ends up in your sites root.

thank you all for your answers and sorry for the late reply because the project took longer than expected. I understand now that it’s more a command line tool than a acual file inside my build.

I was a bit confused as it seems that chrome was handeling budget files on website’s but that was not the case.

Now i’m running the command tool and see what it’s used for, thanks all for the help and making me understand the tool better.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.