genes

Generates split ES6 modules and Typescript definitions from Haxe modules.


Keywords
js
License
MIT
Install
haxelib install genes 0.0.0

Documentation

genes

Build Status

Generates split ES6 modules and Typescript definitions from Haxe modules.

Requires Haxe 4, status: experimental

Usage

lix +lib genes

Install the library and add -lib genes to your hxml.

Options:

  • add -D dts to generate Typescript definition files
  • use -debug or -D js-source-map to generate source maps

Dynamic imports

import genes.Genes.dynamicImport;
import my.module.MyClass;
// ...
dynamicImport(MyClass -> new MyClass()).then(trace);

Translates to:

import('./my/module/MyClass')
  .then(({MyClass}) => new MyClass())
  .then(console.log)

Alternatives

  • Split output with require calls: hxgenjs
  • Typescript definition generation: hxtsdgen