menu

Gatsby.js

Fast in every way that matters. Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.

Channels
# All channels
view-forward
# General
view-forward
# I Made This
view-forward
# Meta
view-forward
# Themes
view-forward
Team

Detect in gatsby-node if app is refreshing via the gatsby refresh endpoint?

February 19, 2020 at 2:05pm

Detect in gatsby-node if app is refreshing via the gatsby refresh endpoint?

February 19, 2020 at 2:05pm
This might need to be a feature request but wanted to check if it already existed. If we are using the gatsby refresh endpoint to refresh our in development, is there some sort of environment variable we can leverage in gatbsy-node.js to detect if the app is rebuilding from the endpoint vs the regular build process?

February 19, 2020 at 8:05pm
What do you mean "via the gatsby refresh endpoint?"
I can say that during gatsby develop, NODE_ENV will be development. During gatsby build, NODE_ENV will be production. I use this check myself when I want to define configurations a certain way when developing vs when in production
  • reply
  • like