This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
This version adds another exported module: happo-plugin-gatsby/filter
. This module can be used in gatsby-node.js
to filter out pages that aren't part of the happo run.
From the README:
Additionally, if you want to speed up the gatsby build or if you're running into errors
from the happo.io API related to payloads being too large, you can limit page creation
to only the pages included in the happo run. Modify (or create)gatsby-node.js
so that
it useshappo-plugin-gatsby/filter
:
// gatsby-node.js
const { onCreatePage, createPageFilter } = require('happo-plugin-gatsby/filter');
exports.onCreatePage = ({ page, actions }) => {
// The provided `onCreatePage` filter will filter out pages that aren't part
// of the happo test suite
onCreatePage({ page, actions });
});
exports.createPages = async ({ graphql, actions }) => {
// The `createPageFilter` function will return a modified/proxied
// `createPage` function that will ignore pages that aren't part of the happo
// test suite
const createPage = createPageFilter(actions.createPage);
createPage({
path: '/foo/',
component: 'some/component/file',
});
}
https://github.com/happo/happo-plugin-gatsby/blob/88cefbaac262f5160230da33409744364e7ad6cc/README.md