@@ -10,14 +10,12 @@ This plugin can be included via npm. Install it as a dependency with the followi
1010npm install --save " @netlify/plugin-lighthouse"
1111```
1212
13- To use a build plugin, create a ` plugins ` in your ` netlify.toml ` like so :
13+ Add the plugin to your ` netlify.toml ` configuration file :
1414
1515``` toml
1616[[plugins ]]
17- package = " @netlify/plugin-lighthouse"
18- [plugins .inputs ]
19- # optional, defaults to scanning the current built version of the site
20- audit_url = ' https://www.my-custom-site.com'
17+ package = " @netlify/plugin-lighthouse"
18+
2119 # optional, fails build when a category is below a threshold
2220 [plugins .inputs .thresholds ]
2321 performance = 0.9
@@ -27,6 +25,30 @@ package = "@netlify/plugin-lighthouse"
2725 pwa = 0.9
2826```
2927
28+ By default, the plugin will serve and audit the build directory of the site.
29+ You can customize the behavior via the ` audits ` input:
30+
31+ ``` toml
32+ [[plugins ]]
33+ package = " @netlify/plugin-lighthouse"
34+
35+ [plugins .inputs .thresholds ]
36+ performance = 0.9
37+
38+ # to audit a sub path of the build directory
39+ # route1 audit will use the top level thresholds
40+ [[plugins .inputs .audits ]]
41+ path = " route1"
42+
43+ # to audit a specific absolute url
44+ [[plugins .inputs .audits ]]
45+ url = " https://www.example.com"
46+
47+ # you can specify thresholds per audit
48+ [plugins .inputs .audits .thresholds ]
49+ performance = 0.8
50+ ```
51+
3052## Running Locally
3153
3254Create a ` .env ` file based on the [ example] ( .env.example ) and run
0 commit comments