JSPM

  • Created
  • Published
  • Downloads 606932
  • Score
    100M100P100Q189957F
  • License MIT

svgo imagemin plugin

Package Exports

  • imagemin-svgo

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (imagemin-svgo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

imagemin-svgo Build Status Build status

svgo imagemin plugin

Install

$ npm install --save imagemin-svgo

Usage

var Imagemin = require('imagemin');
var svgo = require('imagemin-svgo');

var imagemin = new Imagemin()
    .src('images/*.svg')
    .dest('build/images')
    .use(svgo());

imagemin.run(function (err, files) {
    if (err) {
        throw err;
    }

    console.log('Files optimized successfully!'); 
});

You can also use this plugin with gulp:

var gulp = require('gulp');
var svgo = require('imagemin-svgo');

gulp.task('default', function () {
    return gulp.src('images/*.svg')
        .pipe(svgo()())
        .pipe(gulp.dest('build/images'));
});

Options

plugins

Type: Array
Default: []

Customize which SVGO plugins to use.

var imagemin = new Imagemin()
    .use(svgo({ plugins: [{ removeViewBox: false }, { removeEmptyAttrs: false }] }));

License

MIT © imagemin