keepNames
with static class fields and initialization blocks
#2389
Labels
keepNames
with static class fields and initialization blocks
#2389
Static fields and initialization blocks in classes run before the name of the class is set. If the static part is referencing the name of the class, it fails in certain cases.
bundle
orformat
, esbuild does not rename the classes, and therefore the bug does not occur.bundle
, esbuild sets the static class fields after the name, but keeps the static initialization blocks in the class.format
, esbuild keeps both static parts in the class just before setting the name.I suggest moving the function call that sets the name like so:
The text was updated successfully, but these errors were encountered: