Skip to content

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

@Yvem

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

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