Skip to content

Commit

Permalink
Special handling for mobile setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Apr 14, 2021
1 parent de1d250 commit b83cdfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const fs = require('fs');
const path = require('path');
const omit = require('object.omit');
const merge = require('lodash.merge');
const get = require('lodash.get');
const runAudit = require('./runAudit');
const Aggregator = require('./aggregator');

Expand Down Expand Up @@ -52,6 +53,15 @@ module.exports = {
options.lighthouse && omit(options.lighthouse, 'preScript');

this.lightHouseConfig = merge(defaultConfig, this.lightHouseConfig);
// Special handling since some configs are strings but need to be the correct type for Lighthouse
const mobileSetting = get(
this.lightHouseConfig,
'settings.screenEmulation.mobile',
true
);
if (mobileSetting === 'false') {
this.lightHouseConfig.settings.screenEmulation.mobile = false;
}

this.lighthouseFlags = options.verbose > 0 ? { logLevel: 'verbose' } : {};

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"dependencies": {
"lodash.merge": "4.6.2",
"lodash.foreach": "^4.5.0",
"lodash.get": "4.4.2",
"lodash.set": "^4.3.2",
"lighthouse": "7.2.0",
"object.omit": "3.0.0",
Expand Down

0 comments on commit b83cdfa

Please sign in to comment.