-
Notifications
You must be signed in to change notification settings - Fork 2
/
lighthouserc.js
64 lines (64 loc) · 3.32 KB
/
lighthouserc.js
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
59
60
61
62
63
64
module.exports = {
ci: {
collect: {
// URLs that Lighthouse will visit and test
url: [
"http://localhost:8000/", // home page
"http://localhost:8000/en/documents/", // doc search
"http://localhost:8000/en/documents/8151/", // doc detail — including OpenSeaDragon
"http://localhost:8000/en/documents/8151/scholarship/", // doc scholarship
"http://localhost:8000/en/content/", // content page
],
// The following two commands make Lighthouse start up a Django
// server for us to test against. PYTHONUNBUFFERED is needed to make
// stdout from the server process visible to Lighthouse; when it
// sees the server print "Quit the server with..." it knows the
// server is running and ready to accept HTTP requests. We use the
// --insecure flag so that Django serves static files from static/;
// they first need to be built with Webpack and then collected.
startServerCommand:
"PYTHONUNBUFFERED=1 python manage.py runserver --insecure",
startServerReadyPattern: "Quit the server",
settings: { chromeFlags: "--headless=new" },
},
upload: {
target: "temporary-public-storage",
},
assert: {
preset: "lighthouse:no-pwa",
assertions: {
// ignore warnings about serving files using compression and
// setting long cache times; we'll handle these separately
// using nginx or apache for actual deploys
"uses-text-compression": "off",
"uses-long-cache-ttl": "off",
// erroring about a console issue; seems to be user agent in webpack?
"inspector-issues": "off",
"errors-in-console": "off",
"unminified-css": "off",
"unused-css-rules": "off",
// not quite following strict csp (yet)
"csp-xss": "off",
// this is important, but failing so disable for now
"render-blocking-resources": "off",
// next two are only failing because of OpenSeaDragon, so disable for now
"unsized-images": "off",
"unused-javascript": "off",
// allow 1 offscreen image per page (OpenSeaDragon first image)
"offscreen-images": ["error", { maxLength: 1 }],
// allow larger byte weight for multilingual and transcription fonts
"total-byte-weight": ["error", { minScore: 0.5 }],
// allow larger lcp images in stylesheets for backgrounds (header, footer, etc)
"prioritize-lcp-image": ["error", { minScore: 0.5 }],
// allow redirects for locale
redirects: "off",
// ignore visible text required in aria-label, we need them to differ for icons
"label-content-name-mismatch": "off",
"identical-links-same-purpose": "off",
// ignore error about back/forward cache, bug with using headless mode.
// see https://github.com/GoogleChrome/lighthouse/issues/14784
"bf-cache": "off",
},
},
},
};