Inline enum function javascript target

i have splitted my project in various file js and i have see that the enum function are copied in any files. there is the possibility for inlining this functions?

How split? can you show some JS?

from the same source code haxe i generate 2 different javascript files. and any files have the function enum duplicated. i am curios how know if is possible iniline the enum functions in javascript

Enums unfortunately can’t be @:expose ([js] @:expose enum to js · Issue #4630 · HaxeFoundation/haxe · GitHub) which means they will be duplicated in each output. There’s no way out-of-the-box to work around that.

A solution like Haxe Modular (shameless plug) will emit separated JS files from a single build, without duplications including for enums.

Does something like this work for your case? (beside from being a bit verbose)

I suppose is workable to expose an API to JS, and even so, it should arguably be automatically generated. But I suspect @francescoagati uses a combination of @:expose and extern to share code between Haxe generated JS files.

yes i use @:expose and @:extern for split the code.