Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add import.meta.DEBUG #18417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jkrems
Copy link

@jkrems jkrems commented Oct 21, 2024

Description

Adds an alternative to process.env.NODE_ENV-based guards. It's a simple boolean and doesn't require the use of node-specific APIs in non-node code.

See: https://github.com/jkrems/md/blob/main/import-meta-debug.md
Or just skip ahead to the section that defines this new property: https://github.com/jkrems/md/blob/main/import-meta-debug.md#importmetaDEBUG.

The goal is to have this property reliably available across tools. PRs across bundlers:

I wouldn't be surprised if there's some bikeshedding on the name (.DEBUG vs .DEV vs .development vs ..?). So it's likely a good idea to hold off on landing it in any of the tools before there's a broader consensus on the name. The API itself seems simple enough that I'm not expecting a lot of churn.

@jkrems jkrems force-pushed the jk-import-meta-debug branch 2 times, most recently from ca2800c to 8232f70 Compare October 21, 2024 18:21
Adds an alternative to `process.env.NODE_ENV`-based guards. It's a simple
boolean and doesn't require the use of node-specific APIs in non-node code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant