Skip to content

API needed: an immutable expression to detect production/dev #89

Description

@Yvem

Hi, new contributor here, trying to be help.

As of now, some tools/libs do production<->dev detection for various reasons:

However this process.env.NODE_ENV expression is not available by default in all runtimes, for ex. Cloudflare Workers: alexreardon/tiny-invariant#205 (without node compat)

There are already existing ideas to standardize this feature, for ex into a boolean __DEV__: https://github.com/jaredpalmer/tsdx?tab=readme-ov-file#__dev__

I suggest this feature to be considered in minimum common API. This expression should be easily detected by bundlers but also be working in production, being immutable and set from the outside.

Thanks!

edit: added an example

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions