Skip to content

conditional debug #3894

Open
Open
@Haroenv

Description

@Haroenv

Describe the feature you'd love to see

I'd like to do something like if (myDevCondition) initDebug();, so I can have different output files where that condition is either true or false. I know I could do require('preact/debug'), but that wouldn't translate to pure esm, as it would mean I'd need to process the if out of the code, which currently isn't yet possible.

Maybe initDebug from preact/debug/src/debug.js could be exposed somehow?

Additional context (optional)

In my libraries I'm using preact as a dependency, so people don't necessarily import it themselves.

closest issue I find is #1746 which suggests to "just use require", which probably works on pages, but not really on libraries

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions