npm.io
0.0.1 • Published 6 years ago

@alessio95/image-loader

Licence
ISC
Version
0.0.1
Deps
9
Size
3 kB
Vulns
0
Weekly
0
Stars
1

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

Keywords