-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
55 lines (55 loc) · 4.72 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"name": "grunt-svgmin",
"version": "0.2.1",
"description": "Minify SVG",
"keywords": [
"gruntplugin",
"svg",
"vector",
"graphic",
"image",
"optimize",
"minify"
],
"homepage": "https://github.com/sindresorhus/grunt-svgmin",
"bugs": {
"url": "https://github.com/sindresorhus/grunt-svgmin/issues"
},
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"repository": {
"type": "git",
"url": "git://github.com/sindresorhus/grunt-svgmin.git"
},
"scripts": {
"test": "grunt"
},
"dependencies": {
"svgo": "~0.3.1",
"filesize": "~2.0.0",
"chalk": "~0.3.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-simple-mocha": "~0.4.0"
},
"peerDependencies": {
"grunt": "~0.4"
},
"engines": {
"node": ">=0.8.0"
},
"licenses": {
"type": "MIT"
},
"readme": "# grunt-svgmin [![Build Status](https://secure.travis-ci.org/sindresorhus/grunt-svgmin.png?branch=master)](http://travis-ci.org/sindresorhus/grunt-svgmin)\n\n[Grunt][grunt] tasks to minify SVG using [SVGO](https://github.com/svg/svgo)\n\n> SVG files, especially exported from various editors, usually contains a lot of redundant and useless information such as editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting SVG rendering result.\n\n\n## Getting Started\n\nIf you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:\n\n```sh\nnpm install --save-dev grunt-svgmin\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-svgmin');\n```\n\n[grunt]: http://gruntjs.com\n[Getting Started]: https://github.com/gruntjs/grunt/wiki/Getting-started\n\n\n## Documentation\n\nSee the [Gruntfile](Gruntfile.js) in this repo for a full example.\n\n\n### Example config (static)\n\n```js\ngrunt.initConfig({\n\tsvgmin: {\t\t\t\t\t\t\t\t\t\t\t// Task\n\t\toptions: {\t\t\t\t\t\t\t\t\t\t// Configuration that will be passed directly to SVGO\n\t\t\tplugins: [{\n\t\t\t\tremoveViewBox: false\n\t\t\t}]\n\t\t},\n\t\tdist: {\t\t\t\t\t\t\t\t\t\t\t// Target\n\t\t\tfiles: {\t\t\t\t\t\t\t\t\t// Dictionary of files\n\t\t\t\t'dist/figure.svg': 'app/figure.svg'\t\t// 'destination': 'source'\n\t\t\t}\n\t\t}\n\t}\n});\n\ngrunt.loadNpmTasks('grunt-svgmin');\ngrunt.registerTask('default', ['svgmin']);\n```\n\n### Example config (dynamic)\n\n```js\ngrunt.initConfig({\n\tsvgmin: {\t\t\t\t\t\t// Task\n\t\toptions: {\t\t\t\t\t// Configuration that will be passed directly to SVGO\n\t\t\tplugins: [{\n\t\t\t\tremoveViewBox: false\n\t\t\t}]\n\t\t},\n\t\tdist: {\t\t\t\t\t\t// Target\n\t\t\tfiles: [{\t\t\t\t// Dictionary of files\n\t\t\t\texpand: true,\t\t// Enable dynamic expansion.\n\t\t\t\tcwd: 'img/src',\t\t// Src matches are relative to this path.\n\t\t\t\tsrc: ['**/*.svg'],\t// Actual pattern(s) to match.\n\t\t\t\tdest: 'img/',\t\t// Destination path prefix.\n\t\t\t\text: '.min.svg'\t\t// Dest filepaths will have this extension.\n\t\t\t\t// ie: optimise img/src/branding/logo.svg and store it in img/branding/logo.min.svg\n\t\t\t}]\n\t\t}\n});\n\ngrunt.loadNpmTasks('grunt-svgmin');\ngrunt.registerTask('default', ['svgmin']);\n```\n\n### Available Options/Plugins\n\nsvgmin makes use of the standard SVGO plugin architecture. Therefore, to customize SVG optimisation, you can disable/enable any SVGO plugins listed at the [SVGO repository](https://github.com/svg/svgo/tree/master/plugins).\n\nTo disable plugins with the Gruntfile.js, look for the plugin name at the [SVGO repository](https://github.com/svg/svgo/tree/master/plugins) and copy the plugin name (minus the file extension). Then set its value in the JSON to `false`. To exemplify, here is how the plugins section in the example configuration (illustrated above) might be written with some of the standard SVGO plugins disabled:\n\n```js\nplugins: [{\n\tremoveViewBox: false, \t\t\t\t// don't remove the viewbox atribute from the SVG\n\tremoveUselessStrokeAndFill: false,\t// don't remove Useless Strokes and Fills\n\tremoveEmptyAttrs: false\t\t\t\t// don't remove Empty Attributes from the SVG\n}]\n```\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
"readmeFilename": "readme.md",
"_id": "grunt-svgmin@0.2.1",
"_shasum": "fedd0ab15e2d1805b89f594568ced01642f338dc",
"_from": "grunt-svgmin@~0.2.0",
"_resolved": "https://registry.npmjs.org/grunt-svgmin/-/grunt-svgmin-0.2.1.tgz"
}