@@ -10,8 +10,8 @@ For the most customization options, we recommend installing the Lighthouse plugi
1010
1111` netlify.toml ` file-based installation allows you to:
1212
13- - [ Run Lighthouse audits for different site paths, such as the contact page and site home page] ( #run- lighthouse-for-different-site-paths )
14- - [ Run Lighthouse audits for a desktop device] ( #run-lighthouse-for-the- desktop-experience )
13+ - [ Run Lighthouse audits for different site paths, such as the contact page and site home page] ( #lighthouse-plugin-configuration-options )
14+ - [ Run Lighthouse audits for a desktop device] ( #run-lighthouse-audits- for-desktop )
1515- [ Generate Lighthouse results in a language other than English] ( #generate-lighthouse-results-in-other-languages )
1616
1717### Install plugin through the Netlify UI
@@ -47,6 +47,32 @@ Then add the plugin to your `netlify.toml` configuration file:
4747 output_path = " reports/lighthouse.html"
4848```
4949
50+ The lighthouse scores are automatically printed to the ** Deploy log** in the Netlify UI. For example:
51+
52+ ```
53+ 2:35:07 PM: ────────────────────────────────────────────────────────────────
54+ 2:35:07 PM: 2. onPostBuild command from @netlify/plugin-lighthouse
55+ 2:35:07 PM: ────────────────────────────────────────────────────────────────
56+ 2:35:07 PM:
57+ 2:35:07 PM: Serving and scanning site from directory dist
58+
59+ ...
60+
61+ 2:35:17 PM: {
62+ 2:35:17 PM: results: [
63+ 2:35:17 PM: { title: 'Performance', score: 0.91, id: 'performance' },
64+ 2:35:17 PM: { title: 'Accessibility', score: 0.93, id: 'accessibility' },
65+ 2:35:17 PM: { title: 'Best Practices', score: 0.93, id: 'best-practices' },
66+ 2:35:17 PM: { title: 'SEO', score: 0.81, id: 'seo' },
67+ 2:35:17 PM: { title: 'Progressive Web App', score: 0.4, id: 'pwa' }
68+ 2:35:17 PM: ]
69+ 2:35:17 PM: }
70+ ```
71+
72+ ## Lighthouse plugin configuration options
73+
74+ To customize how Lighthouse runs audits, you can make changes to the ` netlify.toml ` file.
75+
5076By default, the plugin will serve and audit the build directory of the site, inspecting the ` index.html ` .
5177You can customize the behavior via the ` audits ` input:
5278
@@ -88,32 +114,6 @@ You can customize the behavior via the `audits` input:
88114
89115```
90116
91- The lighthouse scores are automatically printed to the ** Deploy log** in the Netlify UI. For example:
92-
93- ```
94- 2:35:07 PM: ────────────────────────────────────────────────────────────────
95- 2:35:07 PM: 2. onPostBuild command from @netlify/plugin-lighthouse
96- 2:35:07 PM: ────────────────────────────────────────────────────────────────
97- 2:35:07 PM:
98- 2:35:07 PM: Serving and scanning site from directory dist
99-
100- ...
101-
102- 2:35:17 PM: {
103- 2:35:17 PM: results: [
104- 2:35:17 PM: { title: 'Performance', score: 0.91, id: 'performance' },
105- 2:35:17 PM: { title: 'Accessibility', score: 0.93, id: 'accessibility' },
106- 2:35:17 PM: { title: 'Best Practices', score: 0.93, id: 'best-practices' },
107- 2:35:17 PM: { title: 'SEO', score: 0.81, id: 'seo' },
108- 2:35:17 PM: { title: 'Progressive Web App', score: 0.4, id: 'pwa' }
109- 2:35:17 PM: ]
110- 2:35:17 PM: }
111- ```
112-
113- ## Lighthouse plugin configuration options
114-
115- To customize how Lighthouse runs audits, you can make changes to the ` netlify.toml ` file.
116-
117117### Run Lighthouse audits for desktop
118118
119119By default, Lighthouse takes a mobile-first performance testing approach and runs audits for the mobile device experience. You can optionally run Lighthouse audits for the desktop experience by including ` preset = "desktop" ` in your ` netlify.toml ` file:
0 commit comments