Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/grunt-svgmin
Minify SVG
https://github.com/sindresorhus/grunt-svgmin
Last synced: 1 day ago
JSON representation
Minify SVG
- Host: GitHub
- URL: https://github.com/sindresorhus/grunt-svgmin
- Owner: sindresorhus
- License: mit
- Created: 2013-03-17T13:48:27.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T16:11:04.000Z (over 1 year ago)
- Last Synced: 2025-01-04T12:47:20.385Z (9 days ago)
- Language: JavaScript
- Homepage:
- Size: 66.4 KB
- Stars: 433
- Watchers: 14
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-images - grunt-svgmin
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`).