metalsmith-svgo

1.0.4 • Public • Published

metalsmith-svgo Build Status NPM version Dependency Status

Compress SVG with Metalsmith.

If you have any issues with the output of this plugin, please use the svgo tracker.

Install

With npm do:

npm install metalsmith-svgo --save

Example

var svgo       = require('metalsmith-svgo'),
    Metalsmith = require('metalsmith');
 
Metalsmith('fixtures')
    .use(svgo())
    .build(function (err) {
        if (err) {
            throw err;
        }
    });

With custom options:

Metalsmith('fixtures')
    .use(svgo({
        plugins: [{
            removeDoctype: false
        }, {
            removeComments: false
        }, {
            cleanupNumericValues: {
                floatPrecision: 2
            }
        }, {
            convertColors: {
                names2hex: false,
                rgb2hex: false
            }
        }]
    }))
    .build(function (err) {
        if (err) {
            throw err;
        }
    });

Options

See the svgo documentation.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs

Readme

Keywords

Package Sidebar

Install

npm i metalsmith-svgo

Weekly Downloads

5

Version

1.0.4

License

MIT

Last publish

Collaborators

  • beneb