Skip to content

Conditional compilation #4671

@dead-claudia

Description

@dead-claudia

Conditional compilation would be fantastic, in my opinion, for things like imports. I would really appreciate something like this:

@if DEBUG
@define HAS_ASSERT
import assert from "assert";
@elif RELEASE
import aRandomModule from "my-cool-module";
@else
@undef FOO
@endif

Not asking for macros (there's not nearly as much of a use case in TypeScript as in e.g. C/C++), but merely having an if-else/define/undef preprocessor would be incredibly helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions