@figma-export/transform-svg-with-svgo
TypeScript icon, indicating that this package has built-in type declarations

6.2.1 • Public • Published

@figma-export/transform-svg-with-svgo

Transformer for @figma-export that optimizes svgs using svgo tool.

Install

Using npm:

npm install --save-dev @figma-export/transform-svg-with-svgo

or using yarn:

yarn add @figma-export/transform-svg-with-svgo --dev

Usage

You can transform an svg before exporting with svgo:

import transformSvgWithSvgo from '@figma-export/transform-svg-with-svgo'

export default {
  commands: [
    ['components', {
      fileId: 'fzYhvQpqwhZDUImRz431Qo',
      onlyFromPages: ['icons', 'unit-test'],
      transformers: [
        transformSvgWithSvgo({
          plugins: [
            {
              name: 'preset-default',
              params: {
                overrides: {
                  removeViewBox: false,
                }
              }
            },
            {
              name: 'removeDimensions'
            }
          ]
        })
      ],
    }],
  ]
}

Package Sidebar

Install

npm i @figma-export/transform-svg-with-svgo

Weekly Downloads

9,819

Version

6.2.1

License

MIT

Unpacked Size

5.04 kB

Total Files

7

Last publish

Collaborators

  • marcomontalbano