Skip to content

Commit

Permalink
force clear GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND flag for commands oth…
Browse files Browse the repository at this point in the history
…er than develop
  • Loading branch information
pieh committed Nov 17, 2020
1 parent ae1f55d commit 91313e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/gatsby/src/services/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,12 @@ export async function initialize({

activity.end()

if (
process.env.gatsby_executing_command === `develop` &&
process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND
) {
if (isCI()) {
if (process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND) {
if (process.env.gatsby_executing_command !== `develop`) {
// we don't want to ever have this flag enabled for anything than develop
// in case someone have this env var globally set
process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND = undefined
} else if (isCI()) {
process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND = undefined
reporter.warn(
`Experimental Query on Demand feature is not available in CI environment. Continuing with regular mode.`
Expand Down

0 comments on commit 91313e6

Please sign in to comment.