Skip to content

Configuring esbuild for bundling classes issue #178

@joshbrew

Description

@joshbrew

I've been piecing together how to use this API from the main guide (the older examples won't load the jsx files) and I am having an issue bundling through esbuild which was used in some of the examples, albeit an older version. For whatever reason, esbuild recompiles the class syntax and then the ECMAscript interpreter can't recognize it. If I just reformat back then it works again, but this rules out bundling in my current config:

Before bundling:
281287424-833c3c45-7f1a-419d-b236-0447e1531b8f

After bundling:
281287335-a05b0f0f-c205-4f65-a3b1-69635cc984f5

So the top works, the bottom doesn't. What esbuild versions are you using or are there some special settings to use to prevent this? Otherwise it's just an esm compilation.

In the examples, the esbuild compilation still preseves the class x syntax instead of this odd var x = class { which anonymizes the class itself. This seems to be innate to esbuild.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions