[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 svgocheck out their documentation.

Install:

npm i -g svgo

Run:

Optimize the svg inside the folder:

svgo -f icons -o icons/out

原文地址:https://www.cnblogs.com/Answer1215/p/6440579.html