Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>SVGOCDNew to Visual Studio Code? Get it now.
SVGOCD

SVGOCD

Stian Haga

|
3,544 installs
| (2) | Free
SVGO extension for VS Code, fully configurable.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info
logo

Build Status code style: prettier downloads Known Vulnerabilities

✨ Features

  • Run SVGO on current open SVG file, or within text selection, through the extension command SVGOCD: Optimize current SVG
  • Looks for and reads svgo.config.{js, mjs, cjs} file in the workspace
  • Configure SVGO plugins directly through the SVGOCDs plugin settings
  • Reports file size change upon optimization

Workflow

⚙️ Settings

Settings can either be configured from the extension settings or having a svgo.config.{js,cjs} file in the workspace directory. A svgo config file will override the extension settings. See the svgo npm package repository for more information about configuration.

⚠️ Note that since the extension runs as a CommonJS module in VS Code, only this format is supported by the plugin.

Config file

/** @type {import('svgo').Config} */
module.exports = {
  multipass:
  js2svg: {
    indent: 2,
    pretty: true,
  },
  plugins: [
    {
      name: 'sortAttrs',
      params: {
        xmlnsOrder: 'alphabetical',
      },
    },
  ],
};

Extension settings

Supports all default SVGO plugin settings through extension settings (svgocd.plugins.*). Boolean values to enable/disable or object values for plugin settings can be used. Full list of plugins from https://github.com/svg/svgo :

View all plugin settings | Plugin | Description | | ------ | ----------- | | [cleanupAttrs](https://github.com/svg/svgo/blob/master/plugins/cleanupAttrs.js) | cleanup attributes from newlines, trailing, and repeating spaces | | [inlineStyles](https://github.com/svg/svgo/blob/master/plugins/inlineStyles.js) | move and merge styles from `
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft