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');
Returns a Promise<Buffer>.
Type: object
Pass options to SVGO.
Type: Buffer
The buffer to optimize.
Overall
Maintained
Code review
Latest release
Releases this year
1,062 followers · starred May 2017
194 followers · starred Aug 2021
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');
Returns a Promise<Buffer>.
Type: object
Pass options to SVGO.
Type: Buffer
The buffer to optimize.
Overall
Maintained
Code review
Latest release
Releases this year
1,062 followers · starred May 2017
194 followers · starred Aug 2021