progressive-img-loader
v1.0.3
Published
a webpack loader for progressive image load
Downloads
2
Readme
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} />