grunt-svgmin

Minify SVG

MIT 20 个版本
安装
npm install grunt-svgmin
yarn add grunt-svgmin
pnpm add grunt-svgmin
bun add grunt-svgmin
README

grunt-svgmin

Minify SVG using SVGO

Issues with the output should be reported on the SVGO issue tracker.

Install

npm install --save-dev grunt-svgmin

Usage

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.

Note

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

版本列表
7.0.0 2023-01-24
6.0.1 2020-07-31
6.0.0 2019-03-21
5.0.0 2017-11-24
4.0.0 2016-09-19
3.3.0 2016-07-07
3.2.0 2016-04-08
3.1.2 2016-01-09
3.1.1 2016-01-05
3.1.0 2015-11-14
3.0.0 2015-11-12
2.0.1 2015-02-24
2.0.0 2014-11-10
1.0.0 2014-09-02
0.4.0 2014-03-03
0.3.1 2014-02-09
0.3.0 2013-11-22
0.2.1 2013-11-01
0.2.0 2013-05-23
0.1.0 2013-04-06