lighthouse-batch icon indicating copy to clipboard operation
lighthouse-batch copied to clipboard

switching between mobile, desktop and mobile&dekstop

Open andreimihale opened this issue 3 years ago • 3 comments

As i can see, the default lighthouse check is mobile. Is there any possibility to change the test between mobile, desktop or do checks for both mobile and desktop?

andreimihale avatar Jun 13 '22 11:06 andreimihale

In case some one else is looking for this as well, I know I was. You can change the configuration of the Lighthouse run using the --params flag and Lighthouse's parameters.

For example to run a batch of desktop tests you can use Lighthouse's desktop preset:

lighthouse-batch -s <url1,url2> --params "--preset desktop"

The Lighthouse docs have more information on the various parameters you can use: Lighthouse Documentation

If you need/want even more control you can use a config file: Lighthouse Configuration

Dhindmarsh avatar Apr 21 '23 17:04 Dhindmarsh

In case some one else is looking for this as well, I know I was. You can change the configuration of the Lighthouse run using the --params flag and Lighthouse's parameters.

For example to run a batch of desktop tests you can use Lighthouse's desktop preset:

lighthouse-batch -s <url1,url2> --params "--preset desktop"

The Lighthouse docs have more information on the various parameters you can use: Lighthouse Documentation

If you need/want even more control you can use a config file: Lighthouse Configuration

The --preset desktop is invalid argument. Invalid values: Argument: preset, Given: "", Choices: "perf", "experimental", "desktop"

Try to add = like this: lighthouse-batch -s <url1,url2> --params "--preset=desktop" Check documentation here: https://github.com/GoogleChrome/lighthouse#cli-options For desktop, --preset=desktop instead. [string] [choices: "mobile", "desktop"]

iftimiedaniel avatar May 31 '23 12:05 iftimiedaniel

Hi there,

In case anyone doesn't get it working using above solution, I have tested using Lighthouse v11.0.0 using the following comment and it works for me.

npx lighthouse-batch -s <url1,url2> -h -p "--config-path=node_modules/lighthouse/core/config/lr-desktop-config.js"

Thanks!

tiansengkear avatar Sep 29 '23 10:09 tiansengkear