Plugin for hermione to minificate reference images (uses optipng).
npm install hermione-image-minifier
Plugin has following configuration:
-
enabled (optional)
Boolean
– enable/disable the plugin; by default plugin is enabled -
compressionLevel (optional)
Number
- compression level from 0 to 7; by default 2
Also there is ability to override plugin parameters by CLI options or environment variables
(see configparser).
Use hermione_image_minifier_
prefix for the environment variables and --hermione-image-minifier-
for the cli options.
Add plugin to your hermione
config file:
module.exports = {
// ...
system: {
plugins: {
'hermione-image-minifier': {
enabled: true,
compressionLevel: 7 // maximal compression, but takes the most time
}
}
},
//...
}
To turn on debug mode set DEBUG=hermione:image-minifier
enviroment variable:
$ DEBUG=hermione:image-minifier ./node_modules/.bin/hermione --update-refs
Console output:
/path/to/reference/image.png compressed by 30%