hermione-image-minifier

0.1.0 • Public • Published

hermione-image-minifier

NPM version Build Status

Plugin for hermione to minificate reference images (uses optipng).

Installation

npm install hermione-image-minifier

Configuration

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.

Usage

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
            }
        }
    },
    //...
}

Debug mode

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%

Package Sidebar

Install

npm i hermione-image-minifier

Weekly Downloads

88

Version

0.1.0

License

MIT

Unpacked Size

10 kB

Total Files

11

Last publish

Collaborators

  • dudagod