Closed malec-palec closed 4 years ago
I was waiting for the output to stabilise before spending time on the parser. Could be worth stating to look into it.
I would like to see this one together with es6 as library (no main, using :@expose
on some classes). For a larger project with other es6 code which ends up bundled with webpack and post-processed by babel.
Bad enough I can compile everything as a JS and then import that JS, but then I lose all the webpack goodies like automatic rebuild on changes
Nevermind... @malec-palec @elsassph yesterday I found myself having this very same problem and I ended up creating a fork of the webpack loader to support raw haxe's builds. It works great with Haxe 4 and ES6 builds but I never tried to split the code into parts since I believe I do not need the feature (I use conditional builds with DCE and webpack passes the whole thing to babel).
https://github.com/vrescobar/webpack-simple-haxe-loader
Since it contains just the minimum amount of features, now it might be trivial to modify the loader to support other variants which deviates from haxe's original behave.
If you're still interested in ES6 support, the PR is done and I would appreciate if you want to test it.
Currently, Haxe Modular is unable to process ES6 classes generated by Haxe 4. It breaks on a simple sample:
with the following error:
ES6 classes support will be a nice to have feature, it provides much cleaner js output and works especially great with ES6 modules' import/export statements.