Skip to main content

Is there a "env" variable to know if the block is running in PROD or DEV mode?

  • August 28, 2020
  • 2 replies
  • 32 views

Forum|alt.badge.img+3

Basically I want to know if the current env is an installed custom block or a local development environment?

2 replies

Forum|alt.badge.img+4

Hey @Ashwin_P

You can use process.env.NODE_ENV to check the environment. The value will be set to development during local development (block run), and production for released blocks.


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • September 8, 2020

Hey @Ashwin_P

You can use process.env.NODE_ENV to check the environment. The value will be set to development during local development (block run), and production for released blocks.


That’s great, Thank you.