Guides

Device Configuration

Last updated by
Harlan Wilton
in doc: clean up.

Introduction

Unlighthouse uses device emulation to test how your website performs on different screen sizes and network conditions. By default, scans emulate a mobile device (375x667) without throttling.

Configuration aliases make it easy to switch between common device types and settings.

Device Types

Desktop Scanning

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  scanner: {
    device: 'desktop',
  },
})

Mobile Scanning (Default)

export default defineUnlighthouseConfig({
  scanner: {
    device: 'mobile',
  },
})

Custom Dimensions

Test specific viewport sizes for responsive breakpoints:

export default defineUnlighthouseConfig({
  lighthouseOptions: {
    screenEmulation: {
      width: 1800,
      height: 1000,
    },
  },
})

Network Throttling

Throttling simulates slower network and CPU conditions for more realistic performance testing:

export default defineUnlighthouseConfig({
  scanner: {
    throttle: true,
  },
})
Throttling is automatically enabled for production sites and disabled for localhost by default.
Did this page help you?