0.0.1 • Published 4 years ago

@alessio95/image-loader v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

image-loader

Loader webpack to resize and compress images

Installation

npm i @alessio95/image-loader

Add the loader on your webpack.config.js

{
  test: /\.(png|svg|jpg|gif)$/,
  use: [
    {
      loader: 'file-loader',
      options: {
        name: 'images/[name].[ext]',
      },
    },
    'image-loader', // Minify & Resize images
  ],
},

The loader recovers all images from your project called in your /s?css/ or js files. His task is to compress your image and resize them.

Resize info :

  • small version : scale(0.5) | divide by 2
  • large version : scale(3) | 1/4 more larger