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

Consider adding the home route to client.js #1514

Closed
jorrit opened this issue Jan 23, 2018 · 1 comment
Closed

Consider adding the home route to client.js #1514

jorrit opened this issue Jan 23, 2018 · 1 comment

Comments

@jorrit
Copy link

jorrit commented Jan 23, 2018

Lots of common code is saved in every page chunk, as can be seen on the attached image.

When the home route is added to the main client.js bundle, all other bundles decrease in size dramatically, because a lot of their code is now already available.

Before:

before

                              Asset     Size  Chunks                    Chunk Names
                 vendor.998cf4ba.js   357 kB       9  [emitted]  [big]  vendor
                       2f751285.png  2.83 kB          [emitted]
          privacy.9d8e5be1.chunk.js  49.5 kB       0  [emitted]         privacy
            about.e3d49ded.chunk.js  49.5 kB       1  [emitted]         about
         register.3143f98f.chunk.js  46.5 kB       2  [emitted]         register
        not-found.1f26e0ee.chunk.js  46.5 kB       3  [emitted]         not-found
            login.89585517.chunk.js  51.5 kB       4  [emitted]         login
             home.4253ebf0.chunk.js  47.8 kB       5  [emitted]         home
          contact.e842d428.chunk.js  46.5 kB       6  [emitted]         contact
            admin.08b1ad44.chunk.js  46.5 kB       7  [emitted]         admin
                 client.667ab492.js  7.73 kB       8  [emitted]         client
                       8844262b.png  6.81 kB          [emitted]
      privacy.9d8e5be1.chunk.js.map   304 kB       0  [emitted]         privacy
        about.e3d49ded.chunk.js.map   304 kB       1  [emitted]         about
     register.3143f98f.chunk.js.map   296 kB       2  [emitted]         register
    not-found.1f26e0ee.chunk.js.map   296 kB       3  [emitted]         not-found
        login.89585517.chunk.js.map   311 kB       4  [emitted]         login
         home.4253ebf0.chunk.js.map   301 kB       5  [emitted]         home
      contact.e842d428.chunk.js.map   296 kB       6  [emitted]         contact
        admin.08b1ad44.chunk.js.map   296 kB       7  [emitted]         admin
             client.667ab492.js.map  51.1 kB       8  [emitted]         client
             vendor.998cf4ba.js.map  2.47 MB       9  [emitted]         vendor

After:

after

                              Asset     Size  Chunks                    Chunk Names
                 vendor.18e1dc82.js   383 kB       8  [emitted]  [big]  vendor
                       2f751285.png  2.83 kB          [emitted]
          privacy.b3ea5668.chunk.js  6.03 kB       0  [emitted]         privacy
            about.dd5d0627.chunk.js  6.04 kB       1  [emitted]         about
         register.017f30a9.chunk.js  3.02 kB       2  [emitted]         register
        not-found.e7232fa8.chunk.js  3.08 kB       3  [emitted]         not-found
            login.3ea865f6.chunk.js  8.07 kB       4  [emitted]         login
          contact.1ed63602.chunk.js     3 kB       5  [emitted]         contact
            admin.99efc062.chunk.js  3.03 kB       6  [emitted]         admin
                 client.93fc2279.js  29.2 kB       7  [emitted]         client
                       8844262b.png  6.81 kB          [emitted]
      privacy.b3ea5668.chunk.js.map  25.7 kB       0  [emitted]         privacy
        about.dd5d0627.chunk.js.map  25.7 kB       1  [emitted]         about
     register.017f30a9.chunk.js.map  17.4 kB       2  [emitted]         register
    not-found.e7232fa8.chunk.js.map  17.6 kB       3  [emitted]         not-found
        login.3ea865f6.chunk.js.map  32.2 kB       4  [emitted]         login
      contact.1ed63602.chunk.js.map  17.3 kB       5  [emitted]         contact
        admin.99efc062.chunk.js.map  17.3 kB       6  [emitted]         admin
             client.93fc2279.js.map   157 kB       7  [emitted]         client
             vendor.18e1dc82.js.map  2.66 MB       8  [emitted]         vendor

I think home.js is loaded most of the time anyway because the homepage usually draws most traffic.

@frenzzy
Copy link
Member

frenzzy commented Jan 23, 2018

I agree, PR is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants