Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sindresorhus/grunt-svgmin

Minify SVG
https://github.com/sindresorhus/grunt-svgmin

Last synced: 1 day ago
JSON representation

Minify SVG

Awesome Lists containing this project

README

        

# grunt-svgmin

> Minify SVG using [SVGO](https://github.com/svg/svgo)

*Issues with the output should be reported on the SVGO [issue tracker](https://github.com/svg/svgo/issues).*

## Install

```sh
npm install --save-dev grunt-svgmin
```

## Usage

```js
require('load-grunt-tasks')(grunt);

grunt.initConfig({
svgmin: {
options: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
sortAttrs: false
}
}
}
]
},
dist: {
files: {
'dist/unicorn.svg': 'app/unicorn.svg'
}
}
}
});

grunt.registerTask('default', ['svgmin']);
```

### Options

The provided options are passed directly to [SVGO](https://github.com/svg/svgo#configuration).

## Note

Per-file savings are only printed in verbose mode (`grunt svgmin --verbose`).