Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

imagemin-svgo GitHub Actions Status

SVGO imagemin plugin

Install

$ npm install imagemin-svgo

Usage

import imagemin from 'imagemin';
import imageminSvgo from 'imagemin-svgo';

(async () => {
	await imagemin(['images/*.svg'], {
		destination: 'build/images',
		plugins: [
			imageminSvgo({
				plugins: [{
					name: 'removeViewBox',
					active: false
				}]
			})
		]
	});

	console.log('Images optimized');
})();

API

imageminSvgo([options])(buffer)

Returns a Promise<Buffer>.

options

Type: Object

Pass options to SVGO.

buffer

Type: Buffer

Buffer to optimize.

License

MIT © imagemin