Broccoli plugin for optimizing SVG files with SVGO
npm install broccoli-svg-optimizer

Broccoli plugin for optimizing SVG files by SVGO with a persistent cache for fast restarts.
npm install --save-dev broccoli-svg-optimizer
``js`
var SVGOptimizer = require('broccoli-svg-optimizer');
var outputNode = new SVGOptimizer(inputNode, {
persist: false,
svgoConfig: {
plugins: [{ removeTitle: true }],
},
});
Type: Object null
Default:
Enable\disable\configure SVGO plugins to customize SVG optimization. Most of the plugins are enabled by default. Check out SVGO repository for available options.
Example:
`js`
svgoConfig: {
plugins: [
{ removeUselessStrokeAndFill: false },
{ removeAttrs: { attrs: '(fill|fill-rule)' } },
{ removeTitle: true },
{ removeDesc: { removeAny: true } },
];
}
Type: reference to a custom svgo module svgo
Default: module defined in broccoli-svg-optimizer dependencies
Sets custom svgo module.
Example:
`js
const SVGOptimizer = require('broccoli-svg-optimizer');
let outputNode = new SVGOptimizer(inputNode, {
svgoModule: require('svgo'),
});
`
Type: Boolean true
Default:
Enable\disable a persistent cache to improve build performance across restarts. Check out broccoli-persistent-filter for more details.
```
npm install
npm test
This project is distributed under the MIT license.
---