Skip to content

Feature request: configure swc's target property #141

Closed
@mbeckem

Description

@mbeckem

Hi,

during developement this plugin currently applies target: "es2020" to swc's JscTarget with no way to change the language level.

In our case this results in JavaScript's private fields being transpiled into WeakMaps, even though all major browser support this feature by now (this makes debugging classes using private fields very unpleasant).

It would help a lot if the plugin would support a target option, e.g.

react({ target: "2022" });

Alternatively, the default target could simply be raised.

Just out of curiosity, why does the plugin's transform hook run on "plain" .ts files (no JSX)?

Thanks!

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