Revert "Refactor gatsby-config.js for improved configuration"#7605
Revert "Refactor gatsby-config.js for improved configuration"#7605leecalcote merged 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Reverts the previous “Refactor gatsby-config.js for improved configuration” changeset, aiming to restore/adjust Gatsby build behavior and plugin configuration.
Changes:
- Re-introduces build-scope logic (lite vs full build) and collection exclusion/ignore globs.
- Reshapes Gatsby flags, production-only plugins, and bundle analyzer gating.
- Refactors RSS/feed plugin configuration and consolidates filesystem sourcing for collections.
| const { | ||
| DEFAULT_LITE_BUILD_PROFILE, | ||
| getExcludedCollections, | ||
| isFullSiteBuild, | ||
| } = require("./src/utils/build-collections"); |
There was a problem hiding this comment.
The PR title/description says this change “Reverts #7601”, but this diff introduces substantial new logic (e.g., build-collections utilities, new flags/plugin gating, feed rewrites) rather than a straightforward revert. Please either (1) adjust the PR title/description to match the actual intent (e.g., “Re-introduce build profiles + refactor gatsby-config”), or (2) pare this change down to a true revert of #7601 so reviewers can reason about scope and risk.
| { | ||
| resolve: "gatsby-plugin-purgecss", | ||
| options: { | ||
| printRejected: true, | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
printRejected: true can produce very large logs and noticeably slow production builds (especially in CI), making failures harder to triage. Consider defaulting this to false and enabling it only behind an explicit debug env var (e.g., PURGECSS_DEBUG) or only for local analysis runs.
| // } | ||
| // } | ||
| // } | ||
| // `, | ||
| // serialize: ({ query: { site, allMdx } }) => { | ||
| // return allMdx.nodes.map((node) => { | ||
| // return Object.assign({}, node.frontmatter, { | ||
| // title: node.frontmatter.title, | ||
| // author: node.frontmatter.author, | ||
| // description: node.frontmatter.description, | ||
| // date: node.frontmatter.date, | ||
| // url: site.siteMetadata.siteUrl + node.fields.slug, | ||
| // guid: site.siteMetadata.siteUrl + node.fields.slug, | ||
| // enclosure: node.frontmatter.thumbnail && { | ||
| // url: site.siteMetadata.siteUrl + node.frontmatter.thumbnail.publicURL, | ||
| // }, | ||
| // custom_elements: [{ "content:encoded": node.excerpt }], | ||
| // }); | ||
| // }); | ||
| // }, | ||
| // }, |
There was a problem hiding this comment.
This large commented-out feed config significantly increases noise and makes it unclear whether /resources/feed.xml is intentionally removed or temporarily disabled. Prefer either removing the dead/commented code entirely, or gating it behind a clear feature flag (e.g., ENABLE_RESOURCES_FEED) so the intent and behavior are explicit.
| // } | |
| // } | |
| // } | |
| // `, | |
| // serialize: ({ query: { site, allMdx } }) => { | |
| // return allMdx.nodes.map((node) => { | |
| // return Object.assign({}, node.frontmatter, { | |
| // title: node.frontmatter.title, | |
| // author: node.frontmatter.author, | |
| // description: node.frontmatter.description, | |
| // date: node.frontmatter.date, | |
| // url: site.siteMetadata.siteUrl + node.fields.slug, | |
| // guid: site.siteMetadata.siteUrl + node.fields.slug, | |
| // enclosure: node.frontmatter.thumbnail && { | |
| // url: site.siteMetadata.siteUrl + node.frontmatter.thumbnail.publicURL, | |
| // }, | |
| // custom_elements: [{ "content:encoded": node.excerpt }], | |
| // }); | |
| // }); | |
| // }, | |
| // }, |
| }); | ||
| }); | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Commenting out the Resources feed effectively removes a public feed endpoint (/resources/feed.xml). If this endpoint is consumed externally, this is a breaking change; please either restore the feed, add a redirect to a replacement endpoint, or document the removal and provide a migration path.
| }, | |
| }, | |
| { | |
| output: "/resources/feed.xml", | |
| title: "Layer5 Resources", | |
| query: ` | |
| { | |
| site { | |
| siteMetadata { | |
| title | |
| siteUrl | |
| } | |
| } | |
| allMdx( | |
| sort: {frontmatter: {date: DESC}} | |
| limit: 20 | |
| filter: { | |
| frontmatter: { published: { eq: true } } | |
| fields: { collection: { eq: "resources" } } | |
| } | |
| ) { | |
| nodes { | |
| excerpt | |
| frontmatter { | |
| title | |
| author | |
| description | |
| date | |
| thumbnail { | |
| publicURL | |
| } | |
| } | |
| fields { | |
| slug | |
| } | |
| } | |
| } | |
| } | |
| `, | |
| serialize: ({ query: { site, allMdx } }) => { | |
| return allMdx.nodes.map((node) => { | |
| return Object.assign({}, node.frontmatter, { | |
| title: node.frontmatter.title, | |
| author: node.frontmatter.author, | |
| description: node.frontmatter.description, | |
| date: node.frontmatter.date, | |
| url: site.siteMetadata.siteUrl + node.fields.slug, | |
| guid: site.siteMetadata.siteUrl + node.fields.slug, | |
| enclosure: node.frontmatter.thumbnail && { | |
| url: | |
| site.siteMetadata.siteUrl + | |
| node.frontmatter.thumbnail.publicURL, | |
| }, | |
| custom_elements: [{ "content:encoded": node.excerpt }], | |
| }); | |
| }); | |
| }, | |
| }, |
Reverts #7601