Skip to content

Instantly share code, notes, and snippets.

@hereswhatidid
Last active February 18, 2019 17:08
Show Gist options
  • Save hereswhatidid/cdc25b94a87e1095bc1cf1487bdc0952 to your computer and use it in GitHub Desktop.
Save hereswhatidid/cdc25b94a87e1095bc1cf1487bdc0952 to your computer and use it in GitHub Desktop.
Run lighthouse from a bashrc function. ex: "lh https://mynewsite.com"
lh() {
lighthouse "$1" --view --chrome-flags="--headless" --config-path="$HOME/lighthouse-config.js"
}
module.exports = {
extends: 'lighthouse:default',
settings: {
onlyCategories: ['performance', 'best-practices'] // 'performance', 'accessibility', 'best-practices', 'seo', 'pwa'
},
};
@hereswhatidid
Copy link
Author

Add the bashrc.sh code to your .bashrc file. You can replace the name of the function with whatever you'd like. The lighthouse-config.js file location will be referenced in the --config-path parameter of the bashrc function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment