-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlighthouserc.js
More file actions
58 lines (54 loc) · 1.68 KB
/
Copy pathlighthouserc.js
File metadata and controls
58 lines (54 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"use strict";
let env = 'dev';
if (process.env.PR_NUMBER && !isNaN(parseInt(process.env.PR_NUMBER))) {
env = `pr-${process.env.PR_NUMBER}`;
} else {
console.log("PR_NUMBER is not defined or is not a number");
}
module.exports = {
ci: {
collect: {
url: [
`https://${env}-drupal-govcon.pantheonsite.io`,
],
settings: {
chromeFlags: '--no-sandbox --ignore-certificate-errors --disable-dev-shm-usage',
preset: 'perf',
onlyCategories: [
'performance',
'accessibility',
'best-practices',
'seo',
],
skipAudits: ['color-contrast']
},
numberOfRuns: 3
},
assert: {
assertions: {
'categories:performance': [
'error',
{ minScore: 0.75, aggregationMethod: 'median-run' },
],
'categories:accessibility': [
'error',
{ minScore: 1, aggregationMethod: 'median-run' },
],
'categories:best-practices': [
'error',
{ minScore: 0.9, aggregationMethod: 'pessimistic' },
],
'categories:seo': [
'error',
{ minScore: 0.6, aggregationMethod: 'pessimistic' },
],
'errors-in-console': ['error', {}],
},
},
},
};
if (process.env.GITHUB_ACTIONS) {
module.exports.ci.upload = {
target: 'temporary-public-storage',
};
}