Include script tag only, when building for production

Is there a variable to check if the build is a production build?

I want to disable Google Tag Manager and Google Analytics in dev

Sage itself has no way to know if it’s in a development or production environment unless you tell it. Usually you would do that using environment variables. Bedrock has some mechanics to set this up using a .env file, so you could look at that implementation of you want to roll your own.

This topic was automatically closed after 42 days. New replies are no longer allowed.