Skip to content

Custom Garie plugin to extract image and bundle sizes

License

Notifications You must be signed in to change notification settings

baneDD/puppeteer-scripts

Repository files navigation

Puppeteer Scripts

Build Status codecov Plugin Built For: Garie License: MIT

This project is built as a plugin for Garie Open Source Web Performance System

These scripts provide useful data about the URLs provided in the config:

  • Number of images on the page
  • Total size of images on the page
  • Number of images not loaded (404s)
  • Number of markup, CSS, JS and Font files loaded on the page
  • Overall size of the markup, CSS, JS and Font files
  • Number of markup, CSS, JS and Font files resulting in 404s

Config Options

To enable the puppeteer-scripts plugin to run, a plugins object is required for the url object. The plugin object should have name property set to puppeteer-scripts. Custom configuration can also be passed in to control the puppeteer page options:

  • userAgent Specific user agent to use in this page
  • pageWaitOn Wait-on string to use for puppeteer page.waitOn eg. ".live-item:nth-of-type(10)"
  • pageGotoOptions JSON string of options to use with puppeteer page.goto eg. "{ timeout: 0, waitUntil: 'networkidle0' }"
  • viewport
    • width page width in pixels. required
    • height page height in pixels. required
    • deviceScaleFactor Specify device scale factor (can be thought of as dpr). Defaults to 1.
    • isMobile Whether the meta viewport tag is taken into account. Defaults to false.
    • hasTouch Specifies if viewport supports touch events. Defaults to false.
    • isLandscape Specifies if viewport is in landscape mode. Defaults to false.

    Execution

    To execute, simply run docker run --shm-size 1G puppeteer-scripts

About

Custom Garie plugin to extract image and bundle sizes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published