Skip to content

Conversation

@saurabhraghuvanshii
Copy link
Contributor

Description

Problem

The build configuration logic was inverted, causing confusion about when collections are ignored:

  • The condition process.env.BUILD_FULL_SITE !== "false" meant that when BUILD_FULL_SITE was undefined, it defaulted to a full build
  • make site-full didn't explicitly set BUILD_FULL_SITE=true, relying on the undefined default
  • This made the behavior implicit and error-prone

Solution

Updated gatsby-config.js to use explicit logic:

  • Changed from process.env.BUILD_FULL_SITE !== "false" to process.env.BUILD_FULL_SITE === "true"
  • Default (undefined) → lightweight build (ignores heavy collections)
  • BUILD_FULL_SITE=false → lightweight build (ignores heavy collections)

Updated package.json to explicitly set BUILD_FULL_SITE=true in the develop script:

  • Ensures make site-full explicitly triggers a full build
    This PR fixes #

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
@l5io
Copy link
Contributor

l5io commented Dec 5, 2025

🚀 Preview for commit 93a5fb7 at: https://69332e57d2d0bb7b2349ed1c--layer5.netlify.app

Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
@l5io
Copy link
Contributor

l5io commented Dec 5, 2025

🚀 Preview for commit 06ccaca at: https://6933332e9520bf82aef56523--layer5.netlify.app

@leecalcote
Copy link
Member

Looks good to me. 👍

@leecalcote leecalcote merged commit 4d8673d into layer5io:master Dec 6, 2025
4 checks passed
@leecalcote
Copy link
Member

Actually, I fail see why this is needed. The existing logic works as expected in my local builds and it seems to be working fine for the production builds that have been recently published.

Where are you seeing that the make targets are not being honored?

@saurabhraghuvanshii
Copy link
Contributor Author

saurabhraghuvanshii commented Dec 6, 2025

@leecalcote The issue was in the npm script, not the make target. Before the fix:

  • make build → npm run build → gatsby build (without BUILD_FULL_SITE=true)
  • So BUILD_FULL_SITE was undefined → isFullSiteBuild = false → collections were skipped

After the fix:

  • make build → npm run build → gatsby build (with BUILD_FULL_SITE=true)
  • So BUILD_FULL_SITE=true → isFullSiteBuild = true → all collections included

The make target works; the npm script it calls needed to set the environment variable. The fix ensures make build includes all collections in production builds

I also experienced that — after about 10 minutes of building, the integration starts building suddenly and uses all of my resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants