I use gulp for the project and added a beacon to the gulp tasks as follows:
gulp.task("lighthouse", function(){ return launchChromeAndRunLighthouse('http://localhost:3800', flags, perfConfig).then(results => { console.log(results); }); });
And this is my launchChromeAndRunLighthouse () function
function launchChromeAndRunLighthouse(url, flags = {}, config = null) { return chromeLauncher.launch().then(chrome => { flags.port = chrome.port; return lighthouse(url, flags, config).then(results => chrome.kill().then(() => results)); }); }
This gives me JSON output on the command line. I can post my JSON here and get a report.
Is there any way to generate an HTML report using gulp ?
You can start a reward if you think this question will be useful to future readers.
google-chrome gulp lighthouse
bhansa
source share