35

Lighthouse plugin that displays the field performance of the page for real-world...

 4 years ago
source link: https://www.tuicool.com/articles/eaANvuY
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

lighthouse-plugin-field-performance

Lighthouse plugin that displays the "field" performance of the page for real-world Chrome users over the last 30 days. This plugin extends the Lighthouse report with the data from Chrome UX Report .

Check Live Example to see the Lighthouse report with the plugin.

2e6rYrq.png!web

Install

Requires node.js >= 10 and Lighthouse >= 5 .

npm install lighthouse-plugin-field-performance

Usage

Use the plugin with Lighthouse CLI or node.js.

CLI

  • Pass plugin to lighthouse lighthouse https://www.apple.com --plugins=lighthouse-plugin-field-performance
  • Pass your PageSpeed Insights token with a custom config lighthouse https://www.apple.com --plugins=lighthouse-plugin-field-performance --config-path=./config.js

config.js

module.exports = {
  extends: 'lighthouse:default',
  settings: {
    psiToken: '0123456789' // use your PSI token
  }
}

Node.js

const { runLighthouse } = require('lighthouse/lighthouse-cli/run')

runLighthouse('https://www.apple.com', {
  plugins: ['lighthouse-plugin-field-performance']
}).then(result => {
  console.log(result)
})

Credits

Sponsored by Treo.sh - Page speed monitoring made easy .


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK