How to Create SVG Sprite With Icons
2023-12-24 00:0:2 Author: hackernoon.com(查看原文) 阅读量:12 收藏

Hackernoon logo

How to Create SVG Sprite With Icons by@gmakarov

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.

featured image - How to Create SVG Sprite With Icons

German Makarov HackerNoon profile picture


@gmakarov

German Makarov


Senior Software Engineer | Frontend | React | TypeScript


Receive Stories from @gmakarov

react to story with heart

RELATED STORIES

Article Thumbnail

Article Thumbnail

Article Thumbnail

Article Thumbnail

Article Thumbnail

L O A D I N G
. . . comments & more!


文章来源: https://hackernoon.com/how-to-create-svg-sprite-with-icons?source=rss
如有侵权请联系:admin#unsafe.sh