Closed AmitMY closed 11 months ago
Possible solution:
// npm install -D @mdi/font @mdi/svg
import { MdiProvider } from 'subset-iconfont';
const mdi = new MdiProvider(['plus', 'circle', 'check'], {
formats: ['ttf', 'woff2'],
});
mdi.makeFonts('./outputDir').then((result) => {
console.log('Done!');
});
from https://stackoverflow.com/questions/64614572/creating-a-material-icons-subset
Dropped material icons as a dependency.
Expected Behavior
Material Icons should only load used icons
Actual Behavior
The Material Icons font is 100kb(!), loads all icons.
Steps to fix?
Use https://fonttools.readthedocs.io/en/latest/subset/index.html to subset the font to only the used glyphs.