1

This might be a silly question...

I've installed SVGO from https://github.com/svg/svgo

I want to turn on the plug-ing that does this:

apply transforms, crop by real width, center vertical alignment and resize SVG with one Path inside (disabled by default)

How do I do this?

From what I understand, I need to find a config file and add it to a plug in list. I'm not sure where to begin. Please help :D

Sebastian Kreft
  • 7,819
  • 3
  • 24
  • 41
Aaron Benjamin
  • 1,291
  • 3
  • 18
  • 27

1 Answers1

1

You want to use the transformsWithOnePath plugin. To use plugons disabled by default you just have to provide a config Object when instantiate SVGO.

For example:

var SVGO = require('svgo'),
    svgo = new SVGO({ 
      plugins: [{
        transformsWithOnePath: {
          width: 200,
          height: 100,
          scale: 10
      }
  }]
});

Seems that this specific plugin applies a serie of transformations on SVG files with only one path inside.

In case you want to add more plugins, just append it to the plugin Array on the configuration object.

Lionel T
  • 1,559
  • 1
  • 13
  • 30