{"id":13417343,"url":"https://github.com/sketch-hq/svgo-compressor","last_synced_at":"2025-05-16T15:08:57.311Z","repository":{"id":8896057,"uuid":"60018990","full_name":"sketch-hq/svgo-compressor","owner":"sketch-hq","description":"A Plugin that compresses SVG assets using SVGO, right when you export them.","archived":false,"fork":false,"pushed_at":"2023-01-06T01:32:55.000Z","size":2419,"stargazers_count":1108,"open_issues_count":19,"forks_count":50,"subscribers_count":64,"default_branch":"develop","last_synced_at":"2025-05-16T05:04:09.166Z","etag":null,"topics":["sketch-app","sketch-plugin","sketchapp","svgo"],"latest_commit_sha":null,"homepage":"https://www.sketch.com/extensions/plugins/svgo-compressor/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sketch-hq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-30T15:07:51.000Z","updated_at":"2025-05-06T07:21:53.000Z","dependencies_parsed_at":"2023-01-11T17:30:06.944Z","dependency_job_id":null,"html_url":"https://github.com/sketch-hq/svgo-compressor","commit_stats":null,"previous_names":["bohemiancoding/svgo-compressor"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sketch-hq%2Fsvgo-compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sketch-hq%2Fsvgo-compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sketch-hq%2Fsvgo-compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sketch-hq%2Fsvgo-compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sketch-hq","download_url":"https://codeload.github.com/sketch-hq/svgo-compressor/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sketch-app","sketch-plugin","sketchapp","svgo"],"created_at":"2024-07-30T22:00:35.572Z","updated_at":"2025-05-16T15:08:52.287Z","avatar_url":"https://github.com/sketch-hq.png","language":"JavaScript","funding_links":[],"categories":["Plugins","JavaScript"],"sub_categories":["Images"],"readme":"# SVGO Compressor\n\nA Plugin that compresses SVG assets using SVGO, right when you export them.\n\n## Install\n\n- Download [SVGO Compressor](https://github.com/sketch-hq/svgo-compressor/releases/latest/download/SVGO.Compressor.sketchplugin.zip) \u0026 unzip it.\n- Double click **SVGO Compressor.sketchplugin** to install the Plugin.\n\n## Usage\n\nSelecting 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.\n\nYou’ll get a message on your document window to let you know the compression worked as expected.\n\nIf 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.\n\n## Custom SVGO configuration\n\nSVGO Compressor uses a default configuration that does a reasonable job of compressing SVG code, while maintaining compatibility and avoiding rendering issues. If you need to change the defaults, you can do so by creating an `svgo.config.js` file in Sketch's `Plugins` directory (located by default in `~/Library/Application\\ Support/com.bohemiancoding.sketch3/Plugins/`).\n\nFor a complete reference of what your SVGO config should look like, see [SVGO’s configuration documentation](https://github.com/svg/svgo#configuration).\n\nAny option that is not set on your custom configuration will use the defaults set by SVGO Compressor. For example, here's how a sample configuration to output unminified code could look like:\n\n```javascript\nmodule.exports = {\n  js2svg: {\n    indent: 2,\n    pretty: true,\n  }\n}\n```\n\nKeep in mind that our defaults do not match the ones in SVGO 100%. If you use the `preset-default` option in SVGO your results may vary from the ones this plugin exports. For the record, here's the default configuration we use:\n\n```\n{\n  path: currentFile, // This is the path to the currently exported SVG asset\n  multipass: true,\n  plugins: [\n    {\n      name: 'preset-default',\n      params: {\n        overrides: {\n          inlineStyles: false,\n          convertStyleToAttrs: true,\n          cleanupListOfValues: true,\n          removeViewBox: false,\n          cleanupEnableBackground: false,\n          removeHiddenElems: false,\n          convertShapeToPath: false,\n          moveElemsAttrsToGroup: false,\n          moveGroupAttrsToElems: false,\n          convertPathData: false,\n          sortAttrs: true,\n        }\n      }\n    }\n  ],\n}\n```\n\n\nAgain, for more information about custom configurations please refer to SVGO's own documentation. Please note that the custom plugins feature is untested in SVGO Compressor, so it may or may not work.\n\n## Acknowledgements\n\nWe would like to thank:\n\n- The [SVGO project](https://github.com/svg/svgo), for creating the golden standard for SVG compression.\n- [Andrey Shakhmin](https://github.com/turbobabr), for his inspiration during the [Hamburg Hackathon](http://designtoolshackday.com), where he showed us how to use node modules inside Sketch.\n\n## Development\n\nThis plugin is built using [skpm](https://github.com/skpm/skpm). To build it, just run\n\n```bash\nnpm i\nnpm run build\n```\n\nTo 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsketch-hq%2Fsvgo-compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsketch-hq%2Fsvgo-compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsketch-hq%2Fsvgo-compressor/lists"}