Skip to content

Latest commit

 

History

History

svgo-optimize

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@figma-extractor/svgo-omptimize

Wrapper around svgo

import { svgoOptimize } from '@figma-extractor/svgo-optimize'

nodes
    .map((node) => svgoOptimize(node))
    .forEach((node) => {
        // node.content overwritten with result of optimization
    })

Exports

  • svgoOptimize(node: Node, plugins: svgo.Plugin[] = defaultPlugins)
  • defaultPlugins: modification of preset-default with removeViewBox turned off
  • currentColorPlugin: replaces fill and stroke with currentColor. Useful for inlined single-colored icons