I'm using imaginmin
with imaginmin-jpegoptim
, but it seems like jpegoptim
isn't being properly utilized. My file size before is 390kb, but after conversion it's 285kb, even though I specified it to be 10kb.
Here's the code:
const imagemin =
require("imagemin")
const imageminJpegoptim =
require("imagemin-jpegoptim")
async function imageminJPG (
inputs,
output_folder,
size
)
{
const files =
await imagemin(
inputs,
{
destination:
output_folder,
plugins:
[
imageminJpegoptim({
progressive:
false,
size // currently 10
})
]
}
)
}
Am I missing a parameter or placing them wrongly?