Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env node */

const isProduction = process.env.NODE_ENV === "production";
const isFullSiteBuild = process.env.BUILD_FULL_SITE !== "false";
const isFullSiteBuild = process.env.BUILD_FULL_SITE === "true";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about if we have all the env variables or at least this env variable in .env.example so that it's easy to understand for new contributors.
Else we can have a comment on top of the const regarding the default behaviour:
// Default is a lightweight build unless BUILD_FULL_SITE is explicitly true

Suggested change
const isFullSiteBuild = process.env.BUILD_FULL_SITE === "true";
// Default is a lightweight build unless BUILD_FULL_SITE is explicitly true
const isFullSiteBuild = process.env.BUILD_FULL_SITE === "true";

const HEAVY_COLLECTIONS = ["members", "integrations"];
const collectionIgnoreGlobs = isFullSiteBuild
? []
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"url": "https://layer5.io"
},
"scripts": {
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 gatsby build",
"build": "cross-env BUILD_FULL_SITE=true NODE_OPTIONS=--max-old-space-size=8192 gatsby build",
"clean": "gatsby clean && rimraf node_modules",
"develop": "cross-env NODE_OPTIONS=--max-old-space-size=8192 env-cmd -f .env.development gatsby develop",
"develop": "cross-env BUILD_FULL_SITE=true NODE_OPTIONS=--max-old-space-size=8192 env-cmd -f .env.development gatsby develop",
"develop:lite": "cross-env BUILD_FULL_SITE=false NODE_OPTIONS=--max-old-space-size=8192 env-cmd -f .env.development gatsby develop",
"dev": "npm run develop",
"start": "npm run develop",
Expand Down