Last active
February 18, 2019 17:08
-
-
Save hereswhatidid/cdc25b94a87e1095bc1cf1487bdc0952 to your computer and use it in GitHub Desktop.
Run lighthouse from a bashrc function. ex: "lh https://mynewsite.com"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lh() { | |
lighthouse "$1" --view --chrome-flags="--headless" --config-path="$HOME/lighthouse-config.js" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
extends: 'lighthouse:default', | |
settings: { | |
onlyCategories: ['performance', 'best-practices'] // 'performance', 'accessibility', 'best-practices', 'seo', 'pwa' | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.