Miss any of our Open RFC calls?Watch the recordings here! »

progressive-img-loader

1.0.3 • Public • Published

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

Install

npm i progressive-img-loader

DownloadsWeekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

4.99 kB

Total Files

6

Last publish

Collaborators

  • avatar