[SVG] Optimize SVGs for Better Performance using svgo
Just like a bitmap image, you can compress an SVG by removing various pieces of code that aren’t necessary to it rendering properly. This reduces file size & download time, ultimately leading to a faster page load speed. You’ll learn how to automate the process of compressing your SVGs using svgo
in the command line.
For a full list of options and plugins available to use with svgo
, check out their documentation.
Install:
npm i -g svgo
Run:
Optimize the svg inside the folder:
svgo -f icons -o icons/out