astro-speed-measurev0.4.0

TimingReport

The object behind every output mode, field by field.

Every output mode is built from one TimingReport. The JSON file is this object, and a function passed as output receives it. All durations are milliseconds.

import type { TimingReport } from '@casoon/astro-speed-measure';

speedMeasure({
  output: (report: TimingReport) => {
    console.log(`build took ${report.totalBuildTime.toFixed(0)} ms`);
  },
});

Fields

Field Content
totalBuildTime From the integration’s astro:config:setup until astro:build:done
integrations[] name, duration, count (hook calls), hooks[] (name, duration, count)
vitePlugins[] Same shape as integrations, per Vite plugin
pages[] pathname, component, duration, type (ssg, ssr, api, unknown)
assets[] path, duration, type (image, style, script, font, other), plugin (first plugin seen for it)
contentCollections[] collection, duration, entries (timed calls), files[]
stages[] name, duration of astro-speed-measure’s own build hooks

All arrays are sorted slowest first. Unlike the console report, the JSON file is not cut off by topPages or topAssets.

The JSON report in the showcase is a complete example from a build of this website.

Package

Edit this page on GitHub · Docs for v0.4.0