[optimization] Avoid to load whole material design font #1242
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Currently we load the whole material design font, this is not so good 😬 ...
This is arround 350 Ko and 1.1Mo downloaded (depending format used by the browser) which is mainly not used.
This PR aims to use @mdi/js which supports webpack tree shaking to only get used icons.
See : https://stackoverflow.com/questions/57552261/vuetifyjs-adding-only-used-icons-to-build
Results
This PR removes warnings below raised by webpack (#1239):
Following Firefox devTools, among of data to load to open main web page is reduced about 600 ko :
1.67 Mo
to1.05 Mo
for leshan-server-demo1.62 Mo
to0.99 Mo
for leshan-bsserver-demoBoth jars also reduce about ~600Ko :
15.1 Mo
to14.5 Mo
for leshan-server-demo13.2 Mo
to12,8 Mo
for leshan-bsserver-demoThis also increases the lighthouse(#1240) score from ~10 point. (But score seems to not be exactly the same each runs...)
E.g. for server-demo (tested locally), before :
Then after :