cli icon indicating copy to clipboard operation
cli copied to clipboard

feat(plugin-lighthouse): add defaultChromeFlag exports

Open BioPhoton opened this issue 1 year ago • 0 comments

User story

ATM we have to use the plugin like this:

import lighthousePlugin from '@code-pushup/lighthouse-plugin';
import {DEFAULT_FLAGS} from 'chrome-launcher/dist/flags.js';

const config = {
  // ...
  await lighthousePlugin('https://github.com/code-pushup/cli/#readme', {
    chromeFlags: DEFAULT_FLAGS.concat(['--headless']),
  }),
}

I would prefere having it exported by us inc the headless on by default:

import lighthousePlugin, {DEFAULT_CHROME_FLAGS} from '@code-pushup/lighthouse-plugin';

const config = {
  // ...
  await lighthousePlugin('https://github.com/code-pushup/cli/#readme', {
    chromeFlags: DEFAULT_CHROME_FLAGS, // this is the default it would work the same if omitted
  }),
}

Acceptance criteria

  • [ ] @code-pushup/lighthouse-plugin exports DEFAULT_CHROME_FLAGS
  • [ ] DEFAULT_CHROME_FLAGS includes --headless
  • [ ] chromeFlagsby default are DEFAULT_CHROME_FLAGS,

Implementation details

No response

BioPhoton avatar Jul 23 '24 18:07 BioPhoton