aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

create separate bundles per route automatically (based on router conf and dependency analysis) #115

Closed atsu85 closed 4 years ago

atsu85 commented 8 years ago

Hi, I found an interesting bundler project (built on top of SystemJS) from following comment:

My team built a bundler ( https://github.com/Swimlane/systemjs-route-bundler ) for auto-magic determining overlapping dependencies and packaging them optimized in production.

Looks like it can be used with Angular 1 to automatically split bundles by route and to extract common code out to shared bundles.

I'm wondering if (more-less) the same approach could be useful for Aurelia as well (and as the comment is copied from the blog post mentioning Aurelia, I suspect the author may have managed to get it working with Aurelia as well - not clear tough). I'm not familiar with the project, but it sounds interesting. The configuration used to detect Angular routes for the bundle inputs seems to be easy to modify to work with Aurelia as well.

I do have one concern tough regarding using the same approach with Aurelia. In addition to scripts we'd like to bundle templates and css files as well, but they are loaded by convention (that is configurable), so I guess this could potentially make things a bit more complicated for Aurelia, but probably still viable approach.

atsu85 commented 8 years ago

@amcdnl, can You comment on this issue? Did You (or Your team) try/manage to get it working with Aurelia? If You got it working, what did You have to do differently compared to Angular, to get it working with Aurelia (did You include html and css as well or just JS?). How do You feel about using/suggesting that plugin (or same approach) for Aurelia?

amcdnl commented 8 years ago

Its not specific to Angular. All you need is a route definition and to use SystemJS.

atsu85 commented 8 years ago

@amcdnl, yes I understood SystemJS and routes part from the lines I linked above (and I understand how to modify the lines for Aurelia to bundle only scripts), but I wanted to know if You have used it with Aurelia as well. And if so, then did You only bundle scripts or html and css as well?

marjan-georgiev commented 8 years ago

We haven't used it with aurelia, only angular, but it shouldn't matter. You can specify your root modules and it builds the route and common bundles based on that. We do bundle html and css as well.

ahmedshuhel commented 8 years ago

Interesting approach. We can certainly use the concept.

EisenbergEffect commented 4 years ago

Closing this issue. The aurelia-bundler library has been superseded by the aurelia-cli.