Skip to content

Commit da5ddbc

Browse files
committed
move
1 parent e4a407e commit da5ddbc

File tree

7 files changed

+811
-811
lines changed

7 files changed

+811
-811
lines changed

lighthouse-core/config/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'use strict';
77

88
const defaultConfigPath = './default-config.js';
9-
const defaultConfig = require('./default-config.js');
9+
const defaultConfig = require('./legacy-default-config.js');
1010
const constants = require('./constants.js');
1111
const format = require('../../shared/localization/format.js');
1212
const validation = require('./../fraggle-rock/config/validation.js');

lighthouse-core/config/default-config.js

Lines changed: 719 additions & 69 deletions
Large diffs are not rendered by default.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* @license Copyright 2018 The Lighthouse Authors. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
*/
6+
'use strict';
7+
8+
const frConfig = require('./default-config.js');
9+
10+
const unsupportedAuditIds = [
11+
'experimental-interaction-to-next-paint',
12+
'uses-responsive-images-snapshot',
13+
];
14+
15+
const audits = frConfig.audits?.filter(audit =>
16+
!unsupportedAuditIds.find(auditId => audit.toString().endsWith(auditId)));
17+
18+
/** @type {LH.Config.Category} */
19+
const performance = {
20+
// @ts-expect-error categories will always exist on the default config.
21+
...frConfig.categories['performance'],
22+
auditRefs: frConfig.categories?.['performance'].auditRefs
23+
.filter(auditRef => !unsupportedAuditIds.includes(auditRef.id)) || [],
24+
};
25+
26+
/** @type {Record<string, LH.Config.Category>} */
27+
const categories = {
28+
...frConfig.categories,
29+
'performance': performance,
30+
};
31+
32+
/** @type {LH.Config.Json} */
33+
const defaultConfig = {
34+
passes: [{
35+
passName: 'defaultPass',
36+
recordTrace: true,
37+
useThrottling: true,
38+
pauseAfterFcpMs: 1000,
39+
pauseAfterLoadMs: 1000,
40+
networkQuietThresholdMs: 1000,
41+
cpuQuietThresholdMs: 1000,
42+
gatherers: [
43+
'css-usage',
44+
'js-usage',
45+
'viewport-dimensions',
46+
'console-messages',
47+
'anchor-elements',
48+
'image-elements',
49+
'link-elements',
50+
'meta-elements',
51+
'script-elements',
52+
'scripts',
53+
'iframe-elements',
54+
'inputs',
55+
'main-document-content',
56+
'global-listeners',
57+
'dobetterweb/doctype',
58+
'dobetterweb/domstats',
59+
'dobetterweb/optimized-images',
60+
'dobetterweb/password-inputs-with-prevented-paste',
61+
'dobetterweb/response-compression',
62+
'dobetterweb/tags-blocking-first-paint',
63+
'seo/font-size',
64+
'seo/embedded-content',
65+
'seo/robots-txt',
66+
'seo/tap-targets',
67+
'accessibility',
68+
'trace-elements',
69+
'inspector-issues',
70+
'source-maps',
71+
'full-page-screenshot',
72+
],
73+
},
74+
{
75+
passName: 'offlinePass',
76+
loadFailureMode: 'ignore',
77+
gatherers: [
78+
'service-worker',
79+
],
80+
}],
81+
audits,
82+
categories,
83+
groups: frConfig.groups,
84+
settings: frConfig.settings,
85+
};
86+
87+
module.exports = defaultConfig;
88+

lighthouse-core/fraggle-rock/config/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const path = require('path');
99
const log = require('lighthouse-logger');
1010
const Runner = require('../../runner.js');
11-
const defaultConfig = require('./default-config.js');
11+
const defaultConfig = require('../../config/default-config.js');
1212
const {defaultNavigationConfig, nonSimulatedPassConfigOverrides} = require('../../config/constants.js'); // eslint-disable-line max-len
1313
const {
1414
isFRGathererDefn,

0 commit comments

Comments
 (0)