Skip to content

imagemin/imagemin-svgo

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imagemin-svgo GitHub Actions Status

SVGO imagemin plugin

Install

 npm install imagemin-svgo

Usage

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

 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

The buffer to optimize.