LetsMesh / Site

Repository for the Website named Let's Mesh
https://letsmesh.vercel.app
6 stars 2 forks source link

[ENHANCEMENT] Switch to using SVGR for svg instead #354

Open misslame opened 3 weeks ago

misslame commented 3 weeks ago

Currently, svgs have massive paths, this is not beneficial for performance loading nor is it very readable, caused huge files.

We should adopt this: https://react-svgr.com/

it allows SVGs to be loaded as react components instead.

Why is this good idea?

blu3eee commented 2 weeks ago

For PR #355, we're manually optimizing SVG files using svgo and importing them as React components with svgr.

We are doing the optimization manually because svgr doesn't seem to be optimizing the SVGs correctly with our current setup. I've tried various svgr configurations in webpack.config.js but none worked as expected.

We'll revisit this later to find a better solution to set up svgr to optimize SVGs automatically with svgo when importing svgs as react components.