developit / grunt-esperanto

Wrapper for the esperanto module transpiler
MIT License
3 stars 4 forks source link

Bundling support #8

Open IjzerenHein opened 9 years ago

IjzerenHein commented 9 years ago

Hi, I was wondering, is there support for bundling in grunt-esperanto? If so, I'd really love to see that feature. cheers!

developit commented 9 years ago

Esperanto doesn't support it, so grunt-esperanto doesn't. I would recommend looking at Babel, with Browserify or WebPack if you're looking to compile your modules into a bundle.

IjzerenHein commented 9 years ago

It doesn't? I was referring to the esperanto.bundle command, which you can use like this:

var fs = require( 'fs' );
var esperanto = require( 'esperanto' );

esperanto.bundle({
  base: 'src', // optional, defaults to current dir
  entry: 'mean.js' // the '.js' is optional
}).then( function ( bundle ) {
  var cjs = bundle.toCjs();
  fs.writeFile( 'dist/mean.js', cjs.code );
});

https://github.com/esperantojs/esperanto/wiki/Bundling-multiple-ES6-modules

developit commented 9 years ago

Oh wow, that's a feature that wasn't offered when I wrote this, and actually something I have a pretty strong need for...

I'm not sure when I would have time to get this added though, since I've already migrated all my projects to Babel. Would happily help debug and review and all that, though.

IjzerenHein commented 9 years ago

I'll see what I can do. I don't have an immediate need for it either, as I've included a separate script for esperanto to address this in my project. Though, I would be nice if I could use it directly from my grunt toolchain. Cheers