Skip to content

Build-time Analysis

siteDevtools.analysis declares the provider, model, and page-report settings required for build-time analysis reports. You only need it when Site DevTools should read those build outputs at runtime.

What It Controls

PartResponsibility
providersDeclares available provider instances such as providers.doubao.
buildReportsDecides which pages generate reports and which model each page uses.
Runtime entryMakes emitted reports available to the runtime console.

It does not change component render strategies, and it does not replace runtime evidence such as the page overlay, Debug Logs, or Render Metrics.

Minimal Example

.vitepress/config.ts
ts
const islands = createDocsIslands({
  adapters: [react()],
  siteDevtools: {
    analysis: {
      providers: {
        doubao: [
          {
            id: 'cn',
            default: true,
            // eslint-disable-next-line no-restricted-syntax
            apiKey: process.env.DOUBAO_API_KEY!,
            baseUrl: 'https://ark.cn-beijing.volces.com/api/v3',
          },
        ],
      },
      buildReports: {
        models: [
          {
            id: 'doubao-pro',
            default: true,
            model: 'doubao-seed-2-0-pro-260215',
            providerRef: {
              provider: 'doubao',
            },
          },
        ],
      },
    },
  },
});

What Happens Without It

The runtime Site DevTools console still works, but build-time analysis reports are not generated, so the console has no page-level report payloads to display.

When to Enable It

In practice, it is better to make the runtime console usable first and add analysis after that. Start with one provider and one model, then use buildReports.resolvePage to enable reports for a small set of important pages instead of the whole site.

Released under the MIT License. (0826c60)

Global Debug Console

docs-islands Runtime Globals

Browse the runtime globals injected by @docs-islands/vitepress and inspect their current live values.

Console helper: window.__DOCS_ISLANDS_SITE_DEVTOOLS__.getGlobal('__PAGE_METAFILE__')

Injected Globals

VitePress runtime site data. Hidden in dev and MPA mode.