Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Réduction et découpage du bundle JS #365

Merged
merged 10 commits into from
Mar 29, 2017
Merged

Réduction et découpage du bundle JS #365

merged 10 commits into from
Mar 29, 2017

Conversation

jdesboeufs
Copy link
Member

Cf #360
Cc @davidbgk

Avant

Fichier Taille (min+gz)
main.js 282.56 KB

Graphe source-map de main.js :

capture d ecran 2017-03-29 a 16 50 12

Travail réalisé

  • Mise à jour des dépendances et activation de Preact Mise à jour des dépendances et activation de preact #363
  • bluebird n'est plus inclus dans le bundle
  • Suppression des polyfills pour Promise, Object.assign et fetch qui étaient déjà inclus (ou le sont désormais) via polyfill.io
  • Seules les méthodes prune et strBackRight de underscore.string sont désormais incluses dans le bundle
  • Les bibliothèques sont désormais réunies dans un fichier vendor.js, ce qui permet d'alléger app.js et de profiter plus efficacement de la mise en cache.
  • Le manifest Webpack sort dans un fichier dédié, pour ne pas impacter la mise en cache de vendor.js

Après

Fichier Taille (min+gz)
vendor.js 155.15 KB
app.js 41.04 KB
manifest.js 837 B

Graphe source-map de vendor.js

capture d ecran 2017-03-29 a 17 04 43

Graphe source-map de app.js :

capture d ecran 2017-03-29 a 17 06 48

Taille totale finale : ~197 KB (- 85.56 KB / - 30 %)

Copy link

@davidbgk davidbgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Let's see how it affects the actual load and execution of the page.

@jdesboeufs jdesboeufs merged commit e84b9be into master Mar 29, 2017
@jdesboeufs jdesboeufs deleted the shrink-bundle branch March 29, 2017 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants