SVGO imagemin plugin
npm install imagemin-svgo
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' ) ;