Closed cambiata closed 3 years ago
Right now you can use a custom js/ts entrypoint to achieve that. Having some metadata to re-export from the main file sounds like a good feature to have though. Maybe we could use @:expose for that purpose.
I've just added support for @:expose
which works pretty much the way you described it. Classes/enums marked with @:expose will be exported from the entrypoint.
Also note that you don't necessarily have to define a --main
class for this purpose if you're not using it. You can include the needed classes or packages directly in your hxml or through a macro. haxe -js lib/index.js -lib genes player
Ah. thanks!
I'm experimenting with creating npm packages through Haxe, and creating vanilla Haxe js libraries and exporting entities to the "npm module root" useing
js.Node.module.export
works fine - they entities then become importable using commonJsrequire
. This is how I do it the commonJs way:As it's nowadays possible to use es6 modules in npm packages - is the corresponding somehow possible when using
genes
?If not, could something like the following be an idea..?
would generate in the haxe compiled boostrap js file:
Best! / Jonas