Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Use Puppeteer (Chrome) to prerender happo.io examples instead of JSDOM

License

Notifications You must be signed in to change notification settings

happo/happo-plugin-puppeteer

Repository files navigation

happo-plugin-puppeteer

A Happo plugin that will replace the default JSDOM pre-rendering with a Puppeteer (which uses Chrome). This plugin can come in handy if you for instance need proper DOM measurements in your Happo examples.

Usage

Make sure to first install the plugin:

npm install --save-dev happo-plugin-puppeteer

Then, add this to your plugins section of your .happo.js config file:

const happoPluginPuppeteer = require('happo-plugin-puppeteer');

module.exports = {
  plugins: [
    happoPluginPuppeteer({
      // ... options go here
    }),
  ],
}

Options

  • launchOptions - options passed to puppeteer.launch. E.g. { args: ['--no-sandbox'] }.

About

Use Puppeteer (Chrome) to prerender happo.io examples instead of JSDOM

Resources

License

Stars

Watchers

Forks

Packages

No packages published