On this page
We ran everything here with vagejs 0.3.0 and Lighthouse 13.5.0 on 24 October 2026; only local paths are shortened.
Step 1: Install Lighthouse
Lighthouse isn't bundled with vagejs (it's large and needs Chrome). Add it once:
npm install --save-dev lighthouseWithout it, the audit says:
Error: Lighthouse is not installed. Run "npm install --save-dev lighthouse" (requires Chrome), or audit without --lighthouse.You'll also need Google Chrome installed. vagejs starts it in the background.
Step 2: Run the audit
npx vage audit --lighthouseThis builds the site, serves it locally and runs Lighthouse on your home page with mobile and then desktop settings. On a fresh starter site:
/ total 1.5 KB js 0.0 KB css 0.0 KB img 0.0 KB font 0.0 KB 1 req
/about/ total 1.3 KB js 0.0 KB css 0.0 KB img 0.0 KB font 0.0 KB 1 req
/blog/ total 1.3 KB js 0.0 KB css 0.0 KB img 0.0 KB font 0.0 KB 1 req
/blog/first-post/ total 1.3 KB js 0.0 KB css 0.0 KB img 0.0 KB font 0.0 KB 1 req
/404/ total 1.3 KB js 0.0 KB css 0.0 KB img 0.0 KB font 0.0 KB 1 req
[lab lighthouse, mobile] http://localhost:4173/: perf 100 a11y 100 seo 100 bp 100 (lighthouse 13.5.0, 2026-10-24T05:59:53.718Z)
[lab lighthouse, desktop] http://localhost:4173/: perf 100 a11y 100 seo 100 bp 100 (lighthouse 13.5.0, 2026-10-24T05:59:59.125Z)
Note: Sizes are uncompressed bytes of local files; transfer size depends on your host's compression.
Note: Automated checks could not decide: color-contrast (5 pages), landmark-one-main (5 pages), page-has-heading-one (5 pages). Review manually or run with --lighthouse (real browser).
Note: Local Lighthouse runs on your machine; scores differ from PageSpeed Insights and from real users.
Note: Lab results (Lighthouse/PageSpeed) are a single simulated load and vary between runs. Field data (CrUX) reflects real Chrome users at the 75th percentile over 28 days and is unavailable for pages or sites without enough traffic. Google's Core Web Vitals assessment uses field data.
Audit of ./dist: 0 error(s), 0 warning(s).That's a lot of text for a perfect result. Let's take it apart.
Reading the output, part by part
The page table. One row per built page, with its weight: the HTML plus every local file it loads, split into JavaScript, CSS, images and fonts, and the number of requests. This part doesn't use Lighthouse at all; vagejs measures the files itself. Each number is compared against a budget (by default 100 KB of JavaScript, 50 KB of CSS, 500 KB of images, 150 KB of fonts, 1,000 KB in total and 30 requests per page). Go over one and you get a warning naming the page.
The lab lines. One line per page and device. The four numbers are Lighthouse's category scores, each out of 100: perf (performance: how quickly the page appears and becomes usable), a11y (accessibility: whether people using screen readers, keyboards or low vision can use it), seo (search basics such as a title, a description and crawlable links) and bp (best practices, a mix of security and modern-web checks). The end of the line says which Lighthouse version ran, and when.
The notes. The "could not decide" note comes from a separate accessibility check (axe) that vagejs runs on every page without a browser. Rules like colour contrast need a real browser, so they're listed for review; Lighthouse checks them on the pages it audits. The last two notes are about lab versus field data, which we'll come back to.
The summary. Budget misses and low lab scores are warnings; serious accessibility problems found by axe are errors.
Step 3: Break it on purpose
Perfect scores teach you nothing, so we made two common mistakes: a 2,400-pixel photo of about 2.8 MB at the top of the home page, and pale grey body text (color: #b0b0b0) on white. Then we audited mobile only:
npx vage audit --lighthouse --strategy mobile / total 2851.9 KB js 0.0 KB css 0.0 KB img 2850.2 KB font 0.0 KB 2 req
...
[lab lighthouse, mobile] http://localhost:4173/: perf 75 a11y 94 seo 100 bp 100 (lighthouse 13.5.0, 2026-10-24T06:05:21.671Z)
- Largest Contentful Paint: 15.2 s
- Improve image delivery: Est savings of 2,225 KiB
- Time to Interactive: 15.2 s
- Avoid enormous network payloads: Total size was 2,852 KiB
warning budget /
image is 2850.2 KB, over the 500 KB budget (performance.budgets.imageKb).
warning budget /
total is 2851.9 KB, over the 1000 KB budget (performance.budgets.totalKb).
warning lab-score http://localhost:4173/
performance 75 < budget 90 (mobile, lighthouse, lab).
warning lab-score http://localhost:4173/
accessibility 94 < budget 95 (mobile, lighthouse, lab).(We've cut the four unchanged page rows and the notes.) Here's how to read it.
The indented list under the lab line is Lighthouse's own findings, worst first. vagejs shows up to eight audits that scored poorly and have a measurement attached. Read them as a story:
- Largest Contentful Paint: 15.2 s. LCP is how long until the biggest thing on the screen, here our photo, finishes appearing. On Lighthouse's simulated slow phone connection, that took 15.2 seconds. Google calls 2.5 seconds or less "good" (that threshold is in the rule pack
npx vage guidelinesshows, with its source). - Improve image delivery: Est savings of 2,225 KiB. The cause. The image is far bigger than a phone screen needs.
- Time to Interactive and Avoid enormous network payloads are the same problem from two other angles.
The lab-score warnings compare each score with your budgets. Performance 75 is under the default 90; accessibility 94 is under the default 95.
But notice what's missing: nothing in the list explains the accessibility drop. vagejs lists findings that come with a measurement, and accessibility checks are pass or fail, so they don't appear. To see which one failed, run Lighthouse on its own and open the full report. With npm run preview running in another terminal, use the address it prints:
npx lighthouse http://localhost:4173/ --output=html --output-path=./lighthouse-report.htmlIn our report, the failed accessibility audit was: "Background and foreground colors do not have a sufficient contrast ratio." Exactly the pale grey text.
Step 4: Fix it and run again
Two changes:
- In
vage.config.ts,images: { optimize: true }, withsharpinstalled (npm install --save-dev sharp). vagejs then makes resized WebP copies of content images (480, 960 and 1,600 pixels wide by default) and lets the browser pick one withsrcset. - In the layout, darker body text:
color: #333.
The next run:
[lab lighthouse, mobile] http://localhost:4173/: perf 100 a11y 100 seo 100 bp 100 (lighthouse 13.5.0, 2026-10-24T06:05:40.485Z)
- Improve image delivery: Est savings of 79 KiBThe two image budget warnings were still there, though. That's a known gap in 0.3.0: the page-weight table measures the original file the image's src points to, not the smaller WebP copy a browser actually downloads. That's fixed since 0.4: the audit now counts the largest copy a browser would load. Resizing very large photos before you add them still keeps both numbers low.
Step 5: Get the raw numbers
For the exact measurements, add --json:
npx vage audit --lighthouse --jsonEach lab report includes the scores plus timings in milliseconds. For our fixed page on mobile, the metrics were:
"metrics": {
"lcpMs": 1803.6496,
"cls": 0,
"tbtMs": 0,
"fcpMs": 617.8248,
"speedIndexMs": 617.8248
}cls is layout shift (how much things jump while loading), and tbtMs is total blocking time, the time the page was too busy running scripts to respond. Both are zero here: no JavaScript, and every image has its size set. AI coding agents should read this JSON rather than the text.
Make it part of your routine
A few settings in vage.config.ts turn this into a habit:
performance: {
budgets: { performance: 90, accessibility: 95, imageKb: 300 },
lighthouse: { enabled: true, pages: ["/", "/blog/"] },
},budgets sets your own limits (the defaults are starting points, not rules). lighthouse.enabled runs Lighthouse on every vage audit, and pages picks the pages it tests (by default, only the home page). --strict makes warnings fail the command, which suits CI. Checks and audits has every option.
What can't a Lighthouse score tell you?
The notes at the end of every audit say this, and it's worth repeating in plain words:
- Lab scores vary. It's one simulated page load on your machine; treat a few points of difference as noise.
- Your machine isn't your visitors' phones. Local Lighthouse, PageSpeed Insights and real users will all give different numbers.
- Google's Core Web Vitals assessment uses field data: measurements from real Chrome users over 28 days, at the 75th percentile. Small sites often don't have enough traffic for any field data at all. Once your site is live,
npx vage audit --url https://your-site.comasks PageSpeed Insights for a lab run and the Chrome UX Report for field data, using your own Google API key (vagejs has none of its own). - A score of 100 isn't a ranking. It means the page did well in a test. Search engines weigh much more than that, and no tool can promise a position.
Reading Lighthouse results: a recap
npm install --save-dev lighthouse, thennpx vage audit --lighthouse.- The table is page weight measured by vagejs; the lab lines are Lighthouse scores out of 100; the indented list is what's costing you, worst first.
- Accessibility failures don't show in that list; open a full Lighthouse report to see them.
--jsongives exact timings;performance.budgetsandperformance.lighthousemake it routine.- Lab scores are a guide, not a verdict. Field data from real visitors is what Google's Core Web Vitals assessment uses.
If your site isn't on vagejs yet, getting started takes about a minute, and a fresh starter is a good baseline to compare against.