craco-image-optimizer-plugin

0.0.5 • Public • Published

Craco Image Optimizer

This is craco plugin.

Optimizer using image-webpack-loader

installation

# npm
$ npm install craco-image-optimizer-plugin

# yarn
$ yarn add craco-image-optimizer-plugin

Usage

We are using the options of image-webpack-loader

See image-webpack-loader for options settings

// craco.config.js
// @see https://github.com/sharegate/craco/blob/master/packages/craco/README.md#configuration-overview
const imageOptimizer = require('craco-image-optimizer-plugin');

module.exports = {
  plugins: [
    {
      plugin: imageOptimizer,
      // image-webpack-plugin options
      options: {
        mozjpeg: {
          progressive: true,
          quality: 65,
        },
        // optipng.enabled: false will disable optipng
        optipng: {
          enabled: false,
        },
        pngquant: {
          quality: [0.65, 0.9],
          speed: 4,
        },
        gifsicle: {
          interlaced: false,
        },
        // the webp option will enable WEBP
        webp: {
          quality: 75,
        },
      },
    },
  ],
};

License

MIT

Package Sidebar

Install

npm i craco-image-optimizer-plugin

Weekly Downloads

693

Version

0.0.5

License

MIT

Unpacked Size

4.65 kB

Total Files

6

Last publish

Collaborators

  • wonbaelee