0.3.1 • Published 5 years ago

lighthouse-compare v0.3.1

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

lighthouse-compare

Note: This is the pre-alpha version. Please contact me to get the API token if you want to use and help improve this service :slightly_smiling_face:.

Feature

What is Lighthouse?

Lighthouse is a tool built and open sourced by Google, which is to improve the quality of web apps.

Lighthouse Compare?

The goal of Ligthouse Compare is to monitor and keep web app’s quality by running Lighthouse in CI and compare reports so that developers can see how a particular changeset influenced the score or any of the audits.

Installation

$ npm install lighthouse-compare lighthouse --save

Usage

  1. Use lighthouse-compare in your test script
// test.js
const cp = require('child_process');
const compare = require('lighthouse-compare');

// build and start to serve locally
cp.execSync('yarn build', { stdio: 'inherit' });
const proc = cp.spawn('yarn', ['serve']);

// run lighthouse analysing
compare.run({ url: 'http://localhost:5001' });
  1. Run script in CI A .travis.yml example:
# need following config for running chrome
sudo: required
dist: trusty

# other config

# run your test script
script: node ./test.js

# add chrome addon to run lighthouse
addons:
  chrome: stable
  1. You should be able to see the report link in the CI logs. image

  2. Click into the link and you can see the report (example). image

TODO

  • Wrap the service with Github App
  • Comment in Pull Request (score and audits diff)
  • Cli tool
0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago