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.
Note: This lesson assumes you have npm
installed.