saguijs / sagui

:monkey: Front-end tooling in a single dependency
http://sagui.js.org/
MIT License
669 stars 32 forks source link

Add support for creating custom chunks/a vendor chunk #415

Closed Deschtex closed 6 years ago

Deschtex commented 6 years ago

At the moment the only chunk, other than the ones produced for the pages, is the common chunk. If you have many dependencies shared between pages, then it's easy for the common chunk to get very large.

A way of mitigating this is to allow the creation of custom chunks. For instance, if all the vendor dependencies are extracted to its own bundle, then the common chunk should decrease in size and you will hopefully also be able to load your application faster since the files will be downloaded in parallel.

So, one option is to add support for creating any chunk you would like, and another option is to add support for specifying what vendors you have and having Sagui create a vendor chunk for you and include it in the entries alongside the common chunk.

See https://github.com/webpack/webpack/tree/master/examples/common-chunk-and-vendor-chunk for details.

WDYT?