Galerie und tage
This commit is contained in:
52
node_modules/imagemin-svgo/readme.md
generated
vendored
52
node_modules/imagemin-svgo/readme.md
generated
vendored
@@ -1,54 +1,52 @@
|
||||
# imagemin-svgo [](https://travis-ci.org/imagemin/imagemin-svgo)
|
||||
# imagemin-svgo [](https://travis-ci.org/imagemin/imagemin-svgo) [](https://ci.appveyor.com/project/ShinnosukeWatanabe/imagemin-svgo/branch/master)
|
||||
|
||||
> [SVGO](https://github.com/svg/svgo) imagemin plugin
|
||||
|
||||
> [svgo](https://github.com/svg/svgo) imagemin plugin
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install imagemin-svgo
|
||||
$ npm install --save imagemin-svgo
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const imagemin = require('imagemin');
|
||||
const Imagemin = require('imagemin');
|
||||
const imageminSvgo = require('imagemin-svgo');
|
||||
|
||||
(async () => {
|
||||
await imagemin(['images/*.svg'], 'build/images', {
|
||||
use: [
|
||||
imageminSvgo({
|
||||
plugins: [
|
||||
{removeViewBox: false}
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
new Imagemin()
|
||||
.src('images/*.svg')
|
||||
.dest('build/images')
|
||||
.use(imageminSvgo())
|
||||
.run();
|
||||
```
|
||||
|
||||
console.log('Images optimized');
|
||||
})();
|
||||
You can also use this plugin with [gulp](http://gulpjs.com):
|
||||
|
||||
```js
|
||||
const gulp = require('gulp');
|
||||
const imageminSvgo = require('imagemin-svgo');
|
||||
|
||||
gulp.task('default', () => {
|
||||
return gulp.src('images/*.svg')
|
||||
.pipe(imageminSvgo()())
|
||||
.pipe(gulp.dest('build/images'));
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### imageminSvgo([options])(buffer)
|
||||
|
||||
Returns a `Promise<Buffer>`.
|
||||
### imageminSvgo(options)
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
Type: `object`
|
||||
|
||||
Pass options to [SVGO](https://github.com/svg/svgo#what-it-can-do).
|
||||
|
||||
#### buffer
|
||||
|
||||
Type: `Buffer`
|
||||
|
||||
Buffer to optimize.
|
||||
Pass options to [svgo](https://github.com/svg/svgo#what-it-can-do).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user