0.2.0 • Published 3 years ago

webpack-image-resize-plugin v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

webpack-webp-convert-plugin

Resize your images using webpack plugin!

Support

Only webpack 5

Before

After

Usage

npm i webpack-image-resize-plugin --save-dev

or

yarn add -D webpack-image-resize-plugin
// webpack.config.js
const WebpackImageResizePlugin = require("webpack-image-resize-plugin");

...
plugins: [
    new ImageResizePlugin({
      gifInfo: {
        width: 100,
        height: 100,
        toWebp: true
      },
      imgInfo: {
        width: 1920,
        height: 1080,
        quality: 100,
        toWebp: true
      },
    }),
]
...

When you use toWebp options.

Please use file-loader like this. (webpack.config.js)

// webpack.config.js

module: {
    rules: [
      {
        test: /\.(png|jpg|jpg|gif|webp)$/i,
        loader: "file-loader",
        options: {
          name: "static/[name].webp",
        },
      },
    ],
  },
0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago