debug icon indicating copy to clipboard operation
debug copied to clipboard

support inlined process.env.DEBUG

Open timvandam opened this issue 1 year ago • 0 comments

Some browser-like environments do not support localStorage nor process.env, but can be provided environment variables because they automatically get inlined (i.e. process.env.XYZ gets replaced by whatever value XYZ is during a build step). This change supports this scenario without breaking previous behavior.

As additional context, I am running into issues when trying to use debug in a Shopify POS extension. These extensions run in a sandboxed version of JS that lacks many built-ins like localStorage. Shopify's build step automatically inlines environment variables, but this still failed because process would not be defined, which the previous code required

timvandam avatar Dec 07 '24 18:12 timvandam