Skip to content

Instantly share code, notes, and snippets.

@gdhardy1
Last active August 24, 2021 14:29
Show Gist options
  • Save gdhardy1/d2c51c31561764214c631a959398db3c to your computer and use it in GitHub Desktop.
Save gdhardy1/d2c51c31561764214c631a959398db3c to your computer and use it in GitHub Desktop.
PREVIEW_OPTIMIZATION Config
module.exports = {
plugins: [
{
resolve: `gatsby-source-wordpress`,
options: {
url: process.env.WORDPRESS_GRAPHQL_ENDPOINT,
presets: [
{
presetName: `PREVIEW_OPTIMIZATION`,
useIf: () =>
(process.env.NODE_ENV === `development` &&
!!process.env.ENABLE_GATSBY_REFRESH_ENDPOINT) ||
process.env.RUNNER_TYPE === `PREVIEW`,
options: {
html: {
useGatsbyImage: false,
createStaticFiles: false,
},
type: {
__all: {
limit: 50,
},
Comment: {
limit: 0,
},
Menu: {
limit: null,
},
MenuItem: {
limit: null,
},
User: {
limit: null,
},
Page: {
limit: null,
},
},
},
},
],
},
},
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment