Skip to main content

bud.imagemin.configure

Use bud.imagemin.configure to customize image-minimizer-webpack-plugin options:

Usage

When using two parameters, you are implicitly operating on the minimizer property.

Using a simple object

bud.config.mjs
export default async bud => {
const minimizer = {options: {encodeOptions: {}}}

bud.imagemin.configure(`squoosh`, minimizer)
}

Using a callback function

bud.config.mjs
export default async bud => {
const callback = minimizer => ({
...minimizer,
/* overload */
})

bud.imagemin.configure(`squoosh`, callback)
}

You may use three parameters to modify other options beyond minimizer:

bud.config.mjs
export default async bud => {
const key = `include`
const value = /\/includes/

bud.imagemin.configure(`squoosh`, key, value)
}

You can use dot syntax when specifying the key parameter:

bud.config.mjs
export default async bud => {
bud.imagemin.configure(
`squoosh`,
`minimizer.options.encodeOptions.mozjpeg`,
{quality: 50},
)
}