Skip to main content
Guides

Route Definitions

Route definitions map framework page files to URL templates and route names.

Nuxt pages

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  site: 'https://example.com',
  routeDefinitions: {
    framework: 'nuxt',
    pagesDir: 'pages',
    extensions: ['vue', 'md'],
  },
})

pagesDir resolves relative to your project root. Static page files can supply concrete seed URLs. Dynamic page files supply templates for matching discovered URLs.

Next.js pages

Use framework: 'next' and set pagesDir to your route directory. Supply concrete dynamic URLs through a sitemap, crawler, or urls.

Select representative routes

Legacy scanner.customSampling does not select routes in the v1 pipeline. Use explicit urls for a representative selection. Use scanner.maxRoutes to bound a broader scan.

Replace discovery.pagesDir and discovery.supportedExtensions with routeDefinitions. See Migrating to v1.

Did this page help you?
Anything that could be done better? :)
Help us improve this page. You can edit this page on GitHub or provide anonymous feedback below.