A Plugin that compresses SVG assets using SVGO, right when you export them.
- Download SVGO Compressor & unzip it.
- Double click SVGO Compressor.sketchplugin to install the Plugin.
Selecting menu items or hitting keys is out of fashion. SVGO Compressor will compress your SVG assets whenever you export them, without you having to do anything.
You’ll get a message on your document window to let you know the compression worked as expected.
If you need uncompressed SVG assets, you can temporarily disable the Plugin by opening Sketch’s Preferences › Plugins and unchecking 'SVGO Compressor'. Or you can right-click any layer and select Copy SVG Code, and that will give you the original, uncompressed code.
We would like to thank:
- The SVGO project, for creating the golden standard for SVG compression.
- Andrey Shakhmin, for his inspiration during the Hamburg Hackathon, where he showed us how to use node modules inside Sketch.
This plugin is built using skpm. To build it, just run
npm i
npm run build
To edit the Plugin's code, edit the code in src
and run npm run build
. You can also run npm run watch
to automatically rebuild the Plugin every time you make changes in the code.