Open jamesplease opened 9 years ago
nvm. You can support bundle without using this plugin at all.
esperanto.bundle({
base: 'src',
entry: 'index.js',
}).then(function(bundle) {
res = bundle.toUmd({
name: 'myLib'
});
$.file('lib.js', res.code, { src: true })
.pipe(gulp.dest('dist'))
.on('end', done);
});
@jmeas ideally this is something I'd want the plugin to support. I haven't looked into it yet as our specific uses of esperanto are fairly behind.
Mmk, cool @Attamusc. In the meantime, for future visitors, here's an implementation that uses esperanto directly.
+1 on bundles
@jmeas Im not too sure what babel does in your script, my understanding is that esperanto will already do the same stuff? Perhaps I'm not understanding the difference between babel and esperanto
Esperanto is a bundler for scripts that use ES2015 module syntax.
Babel is a transpiler that supports most of ES2015 features.
For instance,
window.setTimeout(() => {
console.log('hello');
});
will work if you transpile it first with Babel, but not if you only use Esperanto.
Esperanto offers more module-related features than Babel's implementation, so I use Esperanto for modules and Babel for everything else.
@jmeas Ahh that makes more sense, I just thought they were competing modules. Thanks for the clarification. I'm pretty new to ES6, and modules are the bit I'm most excited about so thats probably why they looked the same
Do you have any interest in supporting esperanto's bundle feature? If so, I can help implement it