Guides
Unlighthouse --desktop Flag & Device Configuration
Run Unlighthouse in desktop mode with the --desktop flag:
npx unlighthouse --site https://example.com --desktopThis overrides the default mobile emulation and scans every page using a desktop viewport. Prefer a config file? Set scanner.device: 'desktop' instead.
When to use --desktop
Mobile is the default because Google uses mobile-first indexing. But desktop scans still matter for:
- B2B SaaS dashboards (95%+ desktop traffic)
- Admin panels and internal tools
- Documentation sites
- Benchmarking against PageSpeed Insights desktop scores
The --desktop flag is equivalent to the --device desktop long form and takes precedence over any config file setting.
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 enabled by default for remote sites and disabled for local sites, such as
localhost. Set scanner.throttle to true or false to override it. 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.