Skip to content

Conversation

thet
Copy link
Member

@thet thet commented Sep 25, 2020

External libriaries (fullcalendar, moment, pikadate, depends_handler, etc) are loaded via dynamic imports on initialization time of the pattern. That way they are only loaded when the pattern is actually used. This reduces bundle size a lot.

There are still many testfailures - but as far as I have tested it, the demos do work.

Before:

-rw-rw-r--  1 thet thet 615K Sep 25 01:10 bundle.js
-rw-rw-r--  1 thet thet 351K Sep 25 01:10 bundle.min.js
-rw-rw-r--  1 thet thet  69K Sep 25 01:10 bundle-polyfills.js
-rw-rw-r--  1 thet thet 2.9K Sep 25 01:10 bundle-polyfills.min.js
-rw-rw-r--  1 thet thet 841K Sep 25 01:10 bundle-vendors.js
drwxrwxr-x  2 thet thet  20K Sep 25 01:10 chunks

After (Note: bundle-vendors is now combined in bundle.js):

-rw-rw-r--  1 thet thet 809K Sep 25 17:14 bundle.js
-rw-rw-r--  1 thet thet 295K Sep 25 17:14 bundle.min.js
-rw-rw-r--  1 thet thet 461K Sep 25 17:14 bundle-polyfills.js
-rw-rw-r--  1 thet thet 142K Sep 25 17:14 bundle-polyfills.min.js
drwxrwxr-x  2 thet thet  12K Sep 25 17:14 chunks

This is the output from webpack-bundle-analyzer:
Screenshot from 2020-09-25 17-22-46

@thet thet requested review from cornae and pilz September 25, 2020 15:24
@thet thet marked this pull request as draft September 25, 2020 15:24
@thet thet marked this pull request as ready for review September 29, 2020 22:40
@thet thet removed the hold merge label Sep 29, 2020
@pilz pilz merged commit 9ae1444 into master Sep 30, 2020
@pilz pilz deleted the thet-lazyloading branch September 30, 2020 07:50
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

Successfully merging this pull request may close these issues.

2 participants