moodle / moodlenet

MoodleNet Project
https://moodle.com/moodlenet
GNU Affero General Public License v3.0
21 stars 12 forks source link

Review webpack bundle config to reduce bundle size #11

Closed aleclofabbro closed 5 months ago

aleclofabbro commented 1 year ago

having reviewed much of webpack/webapp-deps in #9 : invest some time to investigate and attempt to fix webpack vendor bundle weight issue

aleclofabbro commented 1 year ago

@brumasribera : from extensions-manager's ExtensionInfo.tsx removed react-syntax-highlighter so far: that package loads all languages parsers, taking >1MB layout didn't worsen at all (for now), as there are no code blocks in READMEs (so far) let's find a way to load parsers dynamically

the same issue (minor entity) applies to moment : it loads all languages.

aleclofabbro commented 1 year ago

@brumasribera I see the dependency lottie is also quite heavy: it alone takes 613KB+

aleclofabbro commented 1 year ago

resized extensions-manager's package-icon-#s to 128px

aleclofabbro commented 1 year ago

added babel-plugin-direct-import for @mui treeshaking

brumasribera commented 1 year ago

@brumasribera I see the dependency lottie is also quite heavy: it alone takes 613KB+

And for now is not used, but will probably will soon on an upload animation in the resource page.

I just could find any other alternative to show a svg animation.

I could try to use a gif or find a lighter alternative.

aleclofabbro commented 1 year ago

webapp is 1MB lighter : ~2.6MB