es6-macros icon indicating copy to clipboard operation
es6-macros copied to clipboard

Add module support

Open valpackett opened this issue 11 years ago • 4 comments

This patch adds support for latest ES6 module syntax, which is compiled to CommonJS. It uses the same convention for default as Square's es6-module-transpiler, ie. module.exports['default'] / require('something')['default'].

valpackett avatar Jul 10 '14 16:07 valpackett

@jlongster?

valpackett avatar Aug 07 '14 10:08 valpackett

Any updates on this??

nmn avatar Aug 18 '14 20:08 nmn

Sorry guys. I meant to come back to this and think hard about it. Initially I wasn't going to include module support, and leave that to other transpilers.

Since you've committed code though... I'll think about it. Modules are a big feature. I'm almost inclined to split it off into a separate project so that es6-macros focuses on the smaller features that we can simulate almost 100%.

Compiling modules this way is only getting at part of the ES6 features. You don't get live bindings and other stuff. But that's how all ES6->CJS compilers work, so it might be worth having. Let me get back to this in 1-2 weeks. Thanks!

jlongster avatar Aug 18 '14 21:08 jlongster

Well, if you think it belongs in a separate project, I should be the one doing it, because I wrote the code ;-)

valpackett avatar Aug 20 '14 18:08 valpackett