Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haxe -> Javascript target for CommonJs (NodeJs) style output

Haxe's JavaScript exports everything in a Haxe compilation into a single output file. This is great for building applications. For a general purpose library, however, it would be nice if it output a *.js file per *.hx file within my compiled sources.

The intent of this is so that I can create a NodeJs module where the consumer of the library only needs to require() the particular files that they would like to use. Is this currently possible using the Haxe compiler on its own, or via an external tool?

like image 656
bguiz Avatar asked Nov 09 '22 17:11

bguiz


1 Answers

There is the hxgenjs library that can generate one js file per haxe class/enum.

https://github.com/kevinresol/hxgenjs

like image 166
KevinResoL Avatar answered Nov 14 '22 21:11

KevinResoL