use sharp to resize images.
if you need to resize images on all operating systems have a look at: imagemin-jimp
!!! DOES NOT WORK ON WINDOWS !!!
npm install --save imagemin-sharp
const sharpOptions = {
width: 500,
height: 500,
// config will be used as the sharp options object,
// see https://sharp.pixelplumbing.com/en/stable/api-constructor/
config: {
withoutEnlargement: true
},
}
imagemin(input, output, {
plugins: [
imageminSharp(sharpOptions),
],
})