Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

About

craco image optimizer plugin

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.