stealjs / steal-tools

Build easy. Load fast.
https://stealjs.com/docs/steal-tools.html
MIT License
67 stars 23 forks source link

asthmatic bundling support #516

Open devmondo opened 8 years ago

devmondo commented 8 years ago

hi,

is there support for this https://github.com/systemjs/builder#bundle-arithmetic

specially this example

builder.bundle('app/**/* - [app/**/*]', 'dependencies.js', { minify: true, sourceMaps: true });

this allows to create 2 outputs, one the app code it self and the other is the vendor libs. this way the vendor bundle can be utilized in many places or omitted when not needed.

thanks in advanced.

matthewp commented 8 years ago

Yes and no. You can really do anything you want, including customizing the bundling, see the streams API. Doing what you want to do here will take a bit of work and it's not particularly well documented, but in your case you'll want to exclude the bundle stream and provide one yourself.

There's not a higher level API to customize the bundle outputs. For the most part it's not needed as steal-tools smartly bundles resources in an optimized fashion. Maybe there could be another high-level API that gives you equivalent customizability but it doesn't exist yet and is not on my radar to do (I'd rather improve our plugins API and work on general performance improvements).

devmondo commented 8 years ago

thanks for the detailed reply, indeed it is well documented, but as you said it takes some work, looking forward for similar implementation like JSPM.