1.0.3 • Published 6 years ago

progressive-img-loader v1.0.3

Weekly downloads
5
License
MIT
Repository
-
Last release
6 years ago

progressive-img-loader

a webpack loader for progressive image loading.

this repo be aimed at how to write a webpack-loader.

useage

{
  test: /\.(png|jpe?g)$/,
  use: [
    {
      loader: 'progressive-img-loader',
      options: {
        base64: true
      }
    },
    {
      loader: 'url-loader',
      options: {
        limit: 8000
      }
    }
  ]
}

// in component
import icon from './assets/icons/test.png'

// if you hava a component called like 'ProgressiveImage' makes image load progressively.
// the icon.src is the image native source, the icon.thumbnail is thumbnail (base64)
// also you can add 'blur(**px)' make it better
<ProgressiveImage src={icon.thumbnail} data-src={icon.src} />

thx

  1. jimp

  2. file-loader

  3. url-loader

  4. lqip-loader