Too Long; Didn't Read
Developers often insert SVG directly into JSX. This is convenient to use, but it increases the JS bundle size. In the pursuit of optimization, I decided to find another way of using SVG icons without cluttering the bundle. We will talk about SVG sprites, what they are, how to use them, and what tools are available for working with them.
Starting with theory, we will write a script that generates an SVG sprite step by step and conclude by discussing plugins for vite and webpack.