Broccoli plugin for minifying .jpg, .png, .webp, .avif, .jxl and .wp2.
const BroccoliImageMin = require('broccoli-image-min')
const minified = new BroccoliImageMin('app', {
include: ['images/**/*.(jpg|png)']
})
module.exports = minified
const BroccoliImageMin = require('broccoli-image-min')
const minified = new BroccoliImageMin('app/images', {
include: ['**/*.(jpg|png)']
})
module.exports = minified
-
inputNodes
: A single input node, an array of input nodes or a string pointing to a folder. -
options
:include
: An array of Regexp patterns
The returned output node contains minified images matching the options.include
pattern with their directory structure preserved.
Just a quick overview from Globbies documentation
*
matches any number of characters, but not/
?
matches a single character, but not/
**
matches any number of characters, including/
, as long as it's the only thing in a path part{}
allows for a comma-separated list of "or" expressions!
at the beginning of a pattern will negate the match
Various patterns and expected matches.
This project is distributed under the MIT license.