Closed cambiata closed 3 years ago
Should be available now with a define: -D genes.include_extension
Thanks!
Not a lot of people use modules directly in browsers (yet?), but great to have for quick prototype purposes.
By the way, this kind of es6 modules output should be a first class citizen in Haxe js, shouldn't it..? Are there any ongoing discussions about that..? Haven't seen any...
Exporting the whole code base as a single ES6 module is in the works: https://github.com/HaxeFoundation/haxe/pull/10003
Splitting the code in modules would preferably be handled by Haxe, however this was closed without a solution: https://github.com/HaxeFoundation/haxe/issues/5831#event-2882732613
External libraries like genes can handle most of the work though, but could do it quite a bit faster if this was available: https://github.com/HaxeFoundation/haxe/issues/8625
Great project! Thanx!
I notice that out of the box, genes doesn't seem to support browser modules as the seem to need the file extension for import statements:
import {Register} from "./genes/Register.js"
instead ofimport {Register} from "./genes/Register"
Easy to hack the ModuleEmitter.emitImport() of course, replacing
emitString(where);
withemitString(where + '.js');
, but I guess it should better be done properly - probably earlier in the chain. If not, I could create a PR if you like.Best! / Jonas