vendredi 1 février 2019

Webpack: bundle splitting across html pages vs code splitting across client side routes

Are there chunk size / loading time implications in choosing between:

  • Splitting a client side application into multiple bundles and serving them across different html pages (i.e. server side routing /about => about.html => about.bundle.js, etc) (this doesn't mean code splitting can't still be used on sub pages, e.g. admin/dashboard, admin/reports).

  • Serving a single client side application that uses code splitting across client-side routes.

And would the significance of chunk size / loading time most likely be eclipsed by architectural considerations such as:

  • The need/desire to share/isolate state across different routes

  • Overhead of abstracting app initialization code so that it can run in each bundle vs possibility to optimise initialization code per app bundle.

?

In general, why would you choose one approach over the other?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire