---
title: "Single-Page Applications · Unlighthouse"
meta:
  "og:description": "Configure Unlighthouse to scan single-page applications (SPAs) with client-side routing like React, Vue, and Angular apps."
  "og:title": "Single-Page Applications · Unlighthouse"
  description: "Configure Unlighthouse to scan single-page applications (SPAs) with client-side routing like React, Vue, and Angular apps."
---

**Recipes**

# **Single-Page Applications**

[Copy for LLMs](https://unlighthouse.dev/guide/recipes/spa.md)

Scan React, Vue, Angular, and other SPAs with client-side routing. SPAs require JavaScript execution for link discovery and accurate [**Core Web Vitals**](https://unlighthouse.dev/glossary) measurement.

## [Enable JavaScript Execution](#enable-javascript-execution)

Allow Puppeteer to execute JavaScript before extracting page content:

```
import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  scanner: {
    skipJavascript: false, // Enable JS execution for SPAs
  },
})
```

## [Wait for Hydration](#wait-for-hydration)

SPAs often need time to hydrate. Configure wait conditions:

```
export default defineUnlighthouseConfig({
  scanner: {
    skipJavascript: false,
  },
  lighthouseOptions: {
    maxWaitForLoad: 45000, // Wait up to 45s for page load
  },
})
```

## [Provide URLs Manually](#provide-urls-manually)

If automatic crawling misses routes, provide them explicitly:

```
export default defineUnlighthouseConfig({
  urls: [
    '/',
    '/about',
    '/products',
    '/contact',
  ],
  scanner: {
    skipJavascript: false,
  },
})
```

## [SPA Performance Considerations](#spa-performance-considerations)

SPAs typically have worse [**LCP**](https://unlighthouse.dev/glossary/lcp) scores because:

- Content renders after JavaScript execution
- Initial HTML is often empty or minimal
- Hydration adds to [**INP**](https://unlighthouse.dev/glossary/inp) delays

Consider SSR or SSG for content-heavy pages to improve Core Web Vitals.

Enabling JavaScript execution increases scan time but is necessary for accurate SPA scanning.

[Edit this page](https://github.com/harlan-zw/unlighthouse/edit/main/docs/1.guide/recipes/spa.md)

[Markdown For LLMs](https://unlighthouse.dev/guide/recipes/spa.md)

**Did this page help you? **

Anything that could be done better? :)

Help us improve this page. You can [edit this page](https://github.com/harlan-zw/unlighthouse/edit/main/docs/1.guide/recipes/spa.md) on GitHub or provide anonymous feedback below.

[**Large Sites** Scan large websites with thousands of pages efficiently. Configure sampling, URL filtering, and optimization strategies for bulk Lighthouse testing.](https://unlighthouse.dev/guide/recipes/large-sites) [**CLI** Scan your entire website with Lighthouse from the command line. Alternative to lighthouse CLI that audits all pages automatically.](https://unlighthouse.dev/integrations/cli)

**On this page **

- [Enable JavaScript Execution](#enable-javascript-execution)
- [Wait for Hydration](#wait-for-hydration)
- [Provide URLs Manually](#provide-urls-manually)
- [SPA Performance Considerations](#spa-performance-considerations)